/[fgs]/fgs/src/playerdb.c
ViewVC logotype

Diff of /fgs/src/playerdb.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by tps12, Fri Sep 5 00:43:00 2003 UTC revision 1.13 by drysdam, Sat Sep 6 13:20:15 2003 UTC
# Line 662  PUBLIC int find_name(int uid, char* name Line 662  PUBLIC int find_name(int uid, char* name
662  {  {
663    char fname[MAX_FILENAME_SIZE];    char fname[MAX_FILENAME_SIZE];
664    char line[MAX_LINE_SIZE];    char line[MAX_LINE_SIZE];
665      struct stat buf;
666    FILE* fp;    FILE* fp;
667    
668    sprintf(fname, "%s/%d", player_dir, uid);    sprintf(fname, "%s/%d", player_dir, uid);
669      //we have some historical directories in there with
670      //numerical names.  Temporary, but too many double checks
671      //aren't usually a problem
672      if((stat(fname, &buf) != 0) || !(S_ISREG(buf.st_mode)))
673        return -1;
674    fp = fopen(fname, "r");    fp = fopen(fname, "r");
675    if(!fp)    if(!fp)
676      return -1;      return -1;

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26