TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CAMERON CLARK
from: THOMAS MAEDER
date: 1997-08-27 20:37:00
subject: stream bug???

CC>     char string[6];
CC>     strcpy(string,"12345");
CC>     string[strlen(string)] = '\n';
CC>     outf.write(string, strlen(string));
The bug is here. What's written to outf can be anything starting with
CC>     12345#13#10           (where #13 & #10 are ascii characters)
The strlen function  depends  on  the  terminating  0  that  you  have
overwritten  with  '\n'.  In  your  case, the character following '\n'
happened to be 0.
Thomas
---
 þ MM 1.0 #0113 þ Oops... Tried to steal my own tagline!
---------------
* Origin: McMeier & Son BBS (2:301/138)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.