Benjamin A. Okopnik disse: > l1 = strlen(p1); > s1 = sizeof(p1); > l2 = strlen(p2); > s2 = sizeof(p2); I think that there we need to code: > l1 = strlen(buf1); > s1 = sizeof(buf1); > l2 = strlen(buf2); > s2 = sizeof(buf2); but, I coded and the results: # ./a.out `perl -e 'print "A" x 251;print " "; print "B" x 251'` strlen1: 251 sizeof1: 4 strlen2: 251 sizeof2: 4 # ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 251'` strlen1: 254 sizeof1: 4 strlen2: 251 sizeof2: 4 # ./a.out `perl -e 'print "A" x 253;print " "; print "B" x 251'` Segmentation fault # ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 252'` strlen1: 254 sizeof1: 4 strlen2: 254 sizeof2: 4 # ./a.out `perl -e 'print "A" x 251;print " "; print "B" x 252'` strlen1: 251 sizeof1: 4 strlen2: 254 sizeof2: 4 # ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 253'` strlen1: 254 sizeof1: 4 strlen2: 254 sizeof2: 4 # ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 254'` strlen1: 254 sizeof1: 4 strlen2: 254 sizeof2: 4 # ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 255'` strlen1: 254 sizeof1: 4 strlen2: 254 sizeof2: 4 mmm... it seems that buf2 overflowed 2 bytes. try other sizes for SIZE. I have tried 248 and 250. it's amazing that doesn't sigfaults. seems a very special condition. Edinelson Keiji Shimokawa. A jedi prentice owned by Dark Force. -- POP. Nem parece internet grátis. Seja POP você também! Acesse: http://www.pop.com.br/pop_discador.php e baixe o POPdiscador.
This archive was generated by hypermail 2b30 : Wed May 14 2003 - 09:05:45 PDT