TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Lawrence Lucier
from: Johan Siegers
date: 1996-03-01 14:41:12
subject: File writes

Hi Lawrence,

 LL>    EG:   if the first name written to the file is Lawrence Lucier and the
 LL> second John Henry, then the first record will hold the name "Lawrence
 LL> Lucier", but the second record will be "John Henry ier".

 LL> struct copy_name
 LL> {
 LL>     char delim[2];
 LL>     :
 LL> };

 LL>         strcpy(mtag2.delim, "ex");
 LL>         strcpy(mtag2.name, user.name);

I think the problem may be that the file you read does not contain
null-terminated strings. If the source has a fixed length, try to memcpy()
it and null-terminate it.

One more remark: delim[2] = 2 bytes, but strcpy(delim,"xx") will
copy 3 bytes: the two data bytes + NULL.

Bye, Johan.

--- The-Box Point 0.15+ PC
* Origin: johan{at}bitbike.com - CIS: 100120,2502 (2:283/512.16)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 283/512 280/801 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

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™.