Subject: snprintf() problem or I am stupid C programmer
To: 'email@example.com' <firstname.lastname@example.org>
From: Ciarcinski, Adam \(ISS Brussels\) <ACiarcinski@iss.net>
Date: 07/17/2001 11:51:52
First of all, sorry for putting it on this list, but I'm using NetBSD.
I have problem with the following, simple, piece of C code:
char *test = "Test";
snprintf(test, 5, "Passed");
If you compile and run it - crash!
If you change 'char *test' to 'char test' - works!
Tried with egcs-1.1.2 and gcc-2.95.3 on NetBSD-current (yesterday sources).
Please help. Thank you. :)