Re: ASCII pfiles

From: Sammy (Samedi@cris.com)
Date: 01/14/97


On Tue, 14 Jan 1997, Sammy wrote:

-   if(!strcmp(tag, "Desc"))
-     strcpy(player->description, fread_string(fl, line));

Oops duh!  This doesn't work too well with null descriptions.  I think
you'll have to add another char variable like this:

char buf2[MAX_INPUT_LENGTH+1];

And change the above to this:

  if(!strcmp(tag, "Desc")) {
    line = fread_string(fl, buf2));
    if(line && *line)
      strcpy(player->description, line);
  }

Haven't tried this but I think it'll work.  The previous fix will
definitely give you plenty of segfaults.

Sam


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST