[CICRLE][CODE] plrtoascii.c minor patch

From: Alaron (digital@together.net)
Date: 06/08/99


Heya all, after the past few messages about plrtoascii and having trouble
with 3, and 11 character names I added this little section so that it will
ignore 3 character and 11 character names and log them into a file so you
may be able to re-imburse any who cannot get converted.

in:
void convert(char *filename)
{
  FILE *fl;
  struct char_file_u player;
  FBFILE *outfile, *index_file;

add this line below

  FILE *efile;


Then down a bit:

  if (!(fl = fopen(filename, "r+"))) {
    perror("error opening playerfile");
    exit(1);
  }

add this line below

  if (!(efile = fopen("player_errors", "w"))) {
    perror("error opening player error file");
    exit(1);

Then change:

  for(i = 0;
      (*(bits + i) = LOWER(*(player.name + i))); i++);
      sprintf(outname, "pfiles/%c/%s", *bits, bits);
      printf("writing: %s\n", outname);

to:

    for(i = 0;
      (*(bits + i) = LOWER(*(player.name + i))); i++);

     if(strlen(bits) == 3){
     fprintf(efile, "Player %s has only 3 characters!\n", bits);

    }
    else if(strlen(bits) == 11){
     fprintf(efile, "Player %s has 11 characters!\r\n", bits);
   }
   else

    sprintf(outname, "pfiles/%c/%s", *bits, bits);
    printf("writing: %s\n", outname);

I know it isn't much but it saves those annoying times when it adds the
garbage to the player directory.

Malcor


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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