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

Diff for /src/usr.bin/patch/util.c between version 1.2 and 1.3

version 1.2, 1996/06/10 11:21:34 version 1.3, 1996/09/24 04:19:30
Line 244 
Line 244 
     int r;      int r;
     bool tty2 = isatty(2);      bool tty2 = isatty(2);
   
     Sprintf(buf, pat, arg1, arg2, arg3);      Snprintf(buf, sizeof buf, pat, arg1, arg2, arg3);
     Fflush(stderr);      Fflush(stderr);
     write(2, buf, strlen(buf));      write(2, buf, strlen(buf));
     if (tty2) {                         /* might be redirected to a file */      if (tty2) {                         /* might be redirected to a file */
Line 428 
Line 428 
         /* Put any leading path into `tmpbuf'.  */          /* Put any leading path into `tmpbuf'.  */
         strncpy(tmpbuf, name, pathlen);          strncpy(tmpbuf, name, pathlen);
   
 #define try(f, a1, a2) (Sprintf(tmpbuf + pathlen, f, a1, a2), stat(tmpbuf, &filestat) == 0)  #define try(f, a1, a2) (Snprintf(tmpbuf + pathlen, sizeof tmpbuf - pathlen, f, a1, a2), stat(tmpbuf, &filestat) == 0)
         if (   try("RCS/%s%s", filebase, RCSSUFFIX)          if (   try("RCS/%s%s", filebase, RCSSUFFIX)
             || try("RCS/%s"  , filebase,         0)              || try("RCS/%s"  , filebase,         0)
             || try(    "%s%s", filebase, RCSSUFFIX)              || try(    "%s%s", filebase, RCSSUFFIX)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3