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/regexp.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/regexp.c')
-rw-r--r-- | usr.bin/less/regexp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/less/regexp.c b/usr.bin/less/regexp.c index 3313855de45..65863bdc97c 100644 --- a/usr.bin/less/regexp.c +++ b/usr.bin/less/regexp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regexp.c,v 1.5 2003/04/06 18:42:57 deraadt Exp $ */ +/* $OpenBSD: regexp.c,v 1.6 2003/04/06 23:38:07 deraadt Exp $ */ /* * regcomp and regexec -- regsub and regerror are elsewhere @@ -1166,7 +1166,8 @@ char *op; case OPEN+7: case OPEN+8: case OPEN+9: - sprintf(buf+strlen(buf), "OPEN%d", OP(op)-OPEN); + snprintf(buf+strlen(buf), sizeof buf - strlen(buf), + "OPEN%d", OP(op)-OPEN); p = NULL; break; case CLOSE+1: @@ -1178,7 +1179,8 @@ char *op; case CLOSE+7: case CLOSE+8: case CLOSE+9: - sprintf(buf+strlen(buf), "CLOSE%d", OP(op)-CLOSE); + snprintf(buf+strlen(buf), sizeof buf - strlen(buf), + "CLOSE%d", OP(op)-CLOSE); p = NULL; break; case STAR: |