I always get a Segmentation fault whenI use snprintf
while `printf? works well.
Example:
int main(){
while(1){
uint8_t tmp = 3;
printf("test %u", tmp); // <--- OUTPUT OK
char * str = " ";
snprintf(str, 10, "test %u", tmp); // <--- SIGSEGV
}
return 0;
}
What is the problem?