diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-30 07:36:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-30 07:36:45 +0000 |
commit | 0f62153ff22c58ff246e73db9768f9eac5dc1bc0 (patch) | |
tree | 99de4ff19cc127b9177e3c02a4c8af7239c2ae73 /usr.sbin/config | |
parent | fbc3641e11aa4c7650b1951a473b7a5eadd38958 (diff) |
snprintf in .y files
Diffstat (limited to 'usr.sbin/config')
-rw-r--r-- | usr.sbin/config/gram.y | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/config/gram.y b/usr.sbin/config/gram.y index 3427fc593b2..f0f7dc5831b 100644 --- a/usr.sbin/config/gram.y +++ b/usr.sbin/config/gram.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: gram.y,v 1.13 2002/05/29 18:39:00 deraadt Exp $ */ +/* $OpenBSD: gram.y,v 1.14 2002/05/30 07:36:44 deraadt Exp $ */ /* $NetBSD: gram.y,v 1.14 1997/02/02 21:12:32 thorpej Exp $ */ /* @@ -286,9 +286,13 @@ locdefault: value: WORD { $$ = $1; } | EMPTY { $$ = $1; } | - signed_number { char bf[40]; - (void)sprintf(bf, FORMAT($1), $1); - $$ = intern(bf); }; + signed_number { + char bf[40]; + + (void)snprintf(bf, sizeof bf, + FORMAT($1), $1); + $$ = intern(bf); + }; signed_number: NUMBER { $$ = $1; } | @@ -449,12 +453,12 @@ setmachine(mch, mcharch) machine = mch; machinearch = mcharch; - (void)sprintf(buf, "arch/%s/conf/files.%s", machine, machine); + (void)snprintf(buf, sizeof buf, "arch/%s/conf/files.%s", machine, machine); if (include(buf, ENDFILE) != 0) exit(1); if (machinearch != NULL) - (void)sprintf(buf, "arch/%s/conf/files.%s", + (void)snprintf(buf, sizeof buf, "arch/%s/conf/files.%s", machinearch, machinearch); else strlcpy(buf, _PATH_DEVNULL, sizeof buf); |