diff options
author | 2003-04-06 23:38:06 +0000 | |
---|---|---|
committer | 2003-04-06 23:38:06 +0000 | |
commit | f09bbe38ff44db8c2f184f3a42ae03e021e9e1db (patch) | |
tree | 0d154493e5b61b9b8b38441cc434925da950c882 /usr.bin/less/lsystem.c | |
parent | snprintf; ok millert (diff) | |
download | wireguard-openbsd-f09bbe38ff44db8c2f184f3a42ae03e021e9e1db.tar.xz wireguard-openbsd-f09bbe38ff44db8c2f184f3a42ae03e021e9e1db.zip |
more strlcpy/strlcat/snprintf, less strcpy/strcat/sprintf
reviewed by tdeval, millert, dhartmei and others. more bits coming here
from some of them i think
Diffstat (limited to 'usr.bin/less/lsystem.c')
-rw-r--r-- | usr.bin/less/lsystem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/less/lsystem.c b/usr.bin/less/lsystem.c index cda57942c5c..9e39a8ed1fe 100644 --- a/usr.bin/less/lsystem.c +++ b/usr.bin/less/lsystem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lsystem.c,v 1.3 2001/11/19 19:02:14 mpech Exp $ */ +/* $OpenBSD: lsystem.c,v 1.4 2003/04/06 23:38:07 deraadt Exp $ */ /* * Copyright (c) 1984,1985,1989,1994,1995 Mark Nudelman @@ -118,9 +118,9 @@ lsystem(cmd) p = save(shell); else { - p = (char *) ecalloc(strlen(shell) + strlen(cmd) + 7, - sizeof(char)); - sprintf(p, "%s -c \"%s\"", shell, cmd); + size_t l = strlen(shell) + strlen(cmd) + 7; + p = (char *) ecalloc(l, sizeof(char)); + snprintf(p, l, "%s -c \"%s\"", shell, cmd); } } if (p == NULL) |