Program received signal SIGSEGV, Segmentation fault.
0x0000000000402aa2 in main (argc=2, argv=0x7fffffffe0d8) at watch.c:541
541 watch.c: No such file or directory.
(gdb) where
#0 0x0000000000402aa2 in main (argc=2, argv=0x7fffffffe0d8) at watch.c:541
(gdb) p argv[0]
$1 = 0x7fffffffe3e4 "/usr/bin/watch"
(gdb) p argv[1]
$2 = 0x7fffffffe3f3 "tail sample.dat"
(gdb) p argv[2]
$3 = 0x0
(gdb) p c
$4 = 8067886
(gdb) p/x c
$5 = 0x7b1b2e
(gdb)
Program received signal SIGSEGV, Segmentation fault. e0d8) at watch.c:541 e0d8) at watch.c:541
0x0000000000402aa2 in main (argc=2, argv=0x7fffffff
541 watch.c: No such file or directory.
(gdb) where
#0 0x0000000000402aa2 in main (argc=2, argv=0x7fffffff
(gdb) p argv[0]
$1 = 0x7fffffffe3e4 "/usr/bin/watch"
(gdb) p argv[1]
$2 = 0x7fffffffe3f3 "tail sample.dat"
(gdb) p argv[2]
$3 = 0x0
(gdb) p c
$4 = 8067886
(gdb) p/x c
$5 = 0x7b1b2e
(gdb)
line 541 is:
I'm suspicious that the isprint should be an iswprint but it might need a libc spec person to know whether isprint should
be safe.