>As a side note, proper use of snprintf would be:
>ret = snprintf(mystr,sizeof(mystr)-1,"Format: %s",var);
No it would not; the proper 2nd argument is the size of whatever
"mystr" points to; for char[] that's sizeof (mystr) (NOT -1) but
for char * it's whatever size you alloc'ed.
>As a side note, proper use of snprintf would be:
>ret = snprintf(mystr,sizeof(mystr)-1,"Format: %s",var);
No it would not; the proper 2nd argument is the size of whatever
"mystr" points to; for char[] that's sizeof (mystr) (NOT -1) but
for char * it's whatever size you alloc'ed.
>Perhaps we sho...
[ more ]