This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Reg. sprintf
- From: "Vivek Katakam" <vivek1717 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 30 May 2006 19:58:22 +0530
- Subject: Reg. sprintf
Hi all,
I am facing Segementation violation in the following function.
Breakpoint 1, main (argc=1, argv=0x7fbfffd7f8) at dr_end.c:230
230 sprintf(detail_filename, "/tmp/%s", mkstemp(filename_template));
(gdb) p detail_filename
$1 = "\000\020\024\227*\000\000\000\226\004V\225*\000\000\000¨Ä\000\226*\000\000\000
)¹\225*", '\0' <repeats 11 times>, "°Ñÿ¿\177\000\000\000\031më\226*",
'\0' <repeats 11 times>, "¨Ä\000\226*\000\000\000F\017V\225*\000\000"
(gdb) p filename_template
$2 = "STARS_filedetail_XXXXXX\000·f\225*\000\000\000\220Óÿ¿\177\000\000\000\020\017V\225*\000\000\000\210Óÿ¿\177\000\000\000\200Óÿ¿\177\000\000\000\001\000\000\000GNU\000\000\000\000\000\000\000\000"
s
Program received signal SIGSEGV, Segmentation fault.
0x0000002a95e45290 in strlen () from /lib64/tls/libc.so.6
I am using gcc 3.2.3
I have initialized the string varibles to null . but i am still
getting the error.
Regards,
Vivek