diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-30 10:53:46 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-05-30 10:53:46 +0000 |
commit | 27fd3e6a6743421739e5ab920b0d40cb00062180 (patch) | |
tree | 1ef7f2807a52f25fac6044b94c573a102d9ec065 /usr.bin/lex/parse.y | |
parent | 3b3586c30c70241fc6f182df78a91d7ebed6ddac (diff) |
use strlcpy and snprintf
Diffstat (limited to 'usr.bin/lex/parse.y')
-rw-r--r-- | usr.bin/lex/parse.y | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/lex/parse.y b/usr.bin/lex/parse.y index 7b2f872efd3..ffebdf06c19 100644 --- a/usr.bin/lex/parse.y +++ b/usr.bin/lex/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.4 2001/06/17 07:30:42 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.5 2002/05/30 10:53:45 deraadt Exp $ */ /* parse.y - parser for flex input */ @@ -35,7 +35,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -/* $Header: /cvs/OpenBSD/src/usr.bin/lex/parse.y,v 1.4 2001/06/17 07:30:42 deraadt Exp $ */ +/* $Header: /cvs/OpenBSD/src/usr.bin/lex/parse.y,v 1.5 2002/05/30 10:53:45 deraadt Exp $ */ /* Some versions of bison are broken in that they use alloca() but don't @@ -796,7 +796,8 @@ void build_eof_action() else { sceof[scon_stk[i]] = true; - sprintf( action_text, "case YY_STATE_EOF(%s):\n", + snprintf( action_text, sizeof action_text, + "case YY_STATE_EOF(%s):\n", scname[scon_stk[i]] ); add_action( action_text ); } @@ -821,7 +822,7 @@ char msg[], arg[]; { char errmsg[MAXLINE]; - (void) sprintf( errmsg, msg, arg ); + (void) snprintf( errmsg, sizeof errmsg, msg, arg ); synerr( errmsg ); } @@ -843,7 +844,7 @@ char msg[], arg[]; { char warn_msg[MAXLINE]; - (void) sprintf( warn_msg, msg, arg ); + (void) snprintf( warn_msg, sizeof warn_msg, msg, arg ); warn( warn_msg ); } @@ -865,7 +866,7 @@ char msg[], arg[]; { char errmsg[MAXLINE]; - (void) sprintf( errmsg, msg, arg ); + (void) snprintf( errmsg, sizeof errmsg, msg, arg ); pinpoint_message( errmsg ); } @@ -889,7 +890,7 @@ int line; if ( ! nowarn ) { - sprintf( warning, "warning, %s", str ); + snprintf( warning, sizeof warning, "warning, %s", str ); line_pinpoint( warning, line ); } } |