Reg. sprintf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux