[BACK]Return to rpc_main.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rpcgen

Diff for /src/usr.bin/rpcgen/rpc_main.c between version 1.15 and 1.16

version 1.15, 2002/07/05 05:39:42 version 1.16, 2003/04/14 04:51:28
Line 224 
Line 224 
         char *file;          char *file;
         char *res;          char *res;
         char *p;          char *p;
           size_t len;
   
         if ((file = strrchr(path, '/')) == NULL)          if ((file = strrchr(path, '/')) == NULL)
                 file = path;                  file = path;
         else          else
                 file++;                  file++;
   
         res = alloc(strlen(file) + strlen(ext) + 1);          len = strlen(file) + strlen(ext) + 1;
           res = alloc(len);
         if (res == NULL) {          if (res == NULL) {
                 fprintf(stderr, "could not allocate memory\n");                  fprintf(stderr, "could not allocate memory\n");
                 exit(1);                  exit(1);
Line 238 
Line 240 
         p = strrchr(file, '.');          p = strrchr(file, '.');
         if (p == NULL)          if (p == NULL)
                 p = file + strlen(file);                  p = file + strlen(file);
         (void) strcpy(res, file);          (void) strlcpy(res, file, len);
         (void) strcpy(res + (p - file), ext);          (void) strlcpy(res, ext, len - (p - file));
         return (res);          return (res);
 }  }
   

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16