=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/patch/util.c 1996/06/10 11:21:34 1.2 +++ src/usr.bin/patch/util.c 1996/09/24 04:19:30 1.3 @@ -1,7 +1,7 @@ -/* $OpenBSD: util.c,v 1.2 1996/06/10 11:21:34 niklas Exp $ */ +/* $OpenBSD: util.c,v 1.3 1996/09/24 04:19:30 millert Exp $ */ #ifndef lint -static char rcsid[] = "$OpenBSD: util.c,v 1.2 1996/06/10 11:21:34 niklas Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.3 1996/09/24 04:19:30 millert Exp $"; #endif /* not lint */ #include "EXTERN.h" @@ -244,7 +244,7 @@ int r; bool tty2 = isatty(2); - Sprintf(buf, pat, arg1, arg2, arg3); + Snprintf(buf, sizeof buf, pat, arg1, arg2, arg3); Fflush(stderr); write(2, buf, strlen(buf)); if (tty2) { /* might be redirected to a file */ @@ -428,7 +428,7 @@ /* Put any leading path into `tmpbuf'. */ 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) || try("RCS/%s" , filebase, 0) || try( "%s%s", filebase, RCSSUFFIX)