No reason for wondering - program will  receive segfault also if you do

puts(NULL)
puts(0)
puts(5)
puts(any non_pointer value)

the same segfault would be on other operating systems,for example, 
FreeBSD(tested=))

The problem is not in puts itself
bash-3.00$ gdb puts
(gdb) r
Starting program: /export/home/wraith/prot_sol/puts

Program received signal SIGSEGV, Segmentation fault.
0xd26f4d20 in countbytes () from /lib/libc.so.1
(gdb)

Try to find an answer=)
http://cvs.opensolaris.org/source/xref/on/usr/src/lib/libc/i386/gen/strlen.s
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to