diff options
-rw-r--r-- | usr.bin/apply/apply.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c index b57ac0e2700..dc7da469a84 100644 --- a/usr.bin/apply/apply.c +++ b/usr.bin/apply/apply.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apply.c,v 1.18 2004/09/14 22:21:57 deraadt Exp $ */ +/* $OpenBSD: apply.c,v 1.19 2005/02/24 12:56:15 jsg Exp $ */ /* $NetBSD: apply.c,v 1.3 1995/03/25 03:38:23 glass Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static const char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94"; #else -static const char rcsid[] = "$OpenBSD: apply.c,v 1.18 2004/09/14 22:21:57 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: apply.c,v 1.19 2005/02/24 12:56:15 jsg Exp $"; #endif #endif /* not lint */ @@ -116,22 +116,22 @@ main(int argc, char *argv[]) err(1, NULL); if (n == 0) { - size_t l; + int l; /* If nargs not set, default to a single argument. */ if (nargs == -1) nargs = 1; l = snprintf(cmd, len, "exec %s", argv[0]); - if (l >= len) - err(1, "snprintf"); + if (l >= len || l == -1) + errx(1, "error building exec string"); len -= l; p = cmd + l; for (i = 1; i <= nargs; i++) { l = snprintf(p, len, " %c%d", magic, i); - if (l >= len) - err(1, "snprintf"); + if (l >= len || l == -1) + errx(1, "error numbering arguments"); len -= l; p += l; } |