Can I use sprintf in a reentrant function if it writes in a local buffer? Something like this:
void reentrant_function () {
int i = 4;
char buffer[20];
snprintf(buffer, 20, "%d", i);
}
Sure you can, unless your buffer
is static
.