diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-24 04:19:31 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-09-24 04:19:31 +0000 |
commit | af0ffdb2def8ccf3dfa0304b9bc45ad743f4cb46 (patch) | |
tree | b5801c95be69301bd73eea07400899e5383dff80 /usr.bin/patch/util.c | |
parent | 3a17bdd392064c10ca3236e7c83d374d3344f842 (diff) |
sprintf -> snprintf except where guaranteed safe.
Diffstat (limited to 'usr.bin/patch/util.c')
-rw-r--r-- | usr.bin/patch/util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/patch/util.c b/usr.bin/patch/util.c index b67a0b8a5bd..1029caca973 100644 --- a/usr.bin/patch/util.c +++ b/usr.bin/patch/util.c @@ -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 @@ long arg1,arg2,arg3; 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 @@ int assume_exists; /* 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) |