diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-06 23:22:44 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-06 23:22:44 +0000 |
commit | e466210857f6bd5671996750e83497c28c1d5485 (patch) | |
tree | a2d1259ed566f5e47fe12ca78fd6a84f14290c3f /usr.bin/apply/apply.c | |
parent | 22a209eb15bd807d8250d44e306c80ce5c4d3296 (diff) |
snprintf; ok millert
he also suggested i use a strlcpy instead of the existing "%s" it used..
Diffstat (limited to 'usr.bin/apply/apply.c')
-rw-r--r-- | usr.bin/apply/apply.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c index 403aec1edf6..802a839dd56 100644 --- a/usr.bin/apply/apply.c +++ b/usr.bin/apply/apply.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apply.c,v 1.12 2003/04/04 00:21:20 deraadt Exp $ */ +/* $OpenBSD: apply.c,v 1.13 2003/04/06 23:22:43 deraadt Exp $ */ /* $NetBSD: apply.c,v 1.3 1995/03/25 03:38:23 glass Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94"; #else -static char rcsid[] = "$OpenBSD: apply.c,v 1.12 2003/04/04 00:21:20 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: apply.c,v 1.13 2003/04/06 23:22:43 deraadt Exp $"; #endif #endif /* not lint */ @@ -179,7 +179,7 @@ main(argc, argv) /* Expand command argv references. */ for (p = cmd, q = c; *p != '\0'; ++p) if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { - sprintf(q, "%s", argv[(++p)[0] - '0']); + strlcpy(q, argv[(++p)[0] - '0'], c + clen - q); q += strlen(q); } else *q++ = *p; |