[ASCII PFILES] remove_player

From: Yoram Harmelin (yoram.harmelin@WANADOO.FR)
Date: 08/05/02


I looked at the code in remove_player, from ascii pfiles, and even after
looking at the man page of unlink, I still don't understand what it really
does. Could someone please point me out, please?

> void remove_player(int pfilepos)
> {
>   char pfile_name[128]/*, rent_name[128]*/;
>
>   if(!*player_table[pfilepos].name)
>     return;
>
>   unlink(pfile_name);
>
>   /* Unlink any other player-owned files here if you have them  */
>
>  log("PCLEAN: %s Lev: %d Last: %s",
>    player_table[pfilepos].name, player_table[pfilepos].level,
>     asctime(localtime(&player_table[pfilepos].last)));
>   player_table[pfilepos].name[0] = '\0';
>   save_player_index();
> }

The problem is with the use of unlink up there, because it takes pfile_name
as argument, and I'm quite sure pfile_name is an empty string when unlink is
called. I think this function is made to remove the pfile of a deleted char,
but here, it doesn't.

Thanks
  Y. Harmelin

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT