O
Olaf
Hi,
does exist a safe version/way of sprintf to prevent a buffer overflow by
using in this manner?
char* format = "0x%0.4X\n";
char buf[4];
sprintf(buf, format, number);
where the format can change at runtime? The buf size is fixed at compile
time.
In the example above the buffer is to small and it's written random in
memory.
Thanks
Olaf
does exist a safe version/way of sprintf to prevent a buffer overflow by
using in this manner?
char* format = "0x%0.4X\n";
char buf[4];
sprintf(buf, format, number);
where the format can change at runtime? The buf size is fixed at compile
time.
In the example above the buffer is to small and it's written random in
memory.
Thanks
Olaf