=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/lex/misc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/lex/misc.c 2002/05/31 00:56:21 1.8 --- src/usr.bin/lex/misc.c 2002/05/31 22:49:29 1.9 *************** *** 1,4 **** ! /* $OpenBSD: misc.c,v 1.8 2002/05/31 00:56:21 deraadt Exp $ */ /* misc - miscellaneous flex routines */ --- 1,4 ---- ! /* $OpenBSD: misc.c,v 1.9 2002/05/31 22:49:29 deraadt Exp $ */ /* misc - miscellaneous flex routines */ *************** *** 28,34 **** * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ ! /* $Header: /cvsrepo/anoncvs/cvs/src/usr.bin/lex/misc.c,v 1.8 2002/05/31 00:56:21 deraadt Exp $ */ #include "flexdef.h" --- 28,34 ---- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ ! /* $Header: /cvsrepo/anoncvs/cvs/src/usr.bin/lex/misc.c,v 1.9 2002/05/31 22:49:29 deraadt Exp $ */ #include "flexdef.h" *************** *** 46,52 **** return; } ! sprintf( buf, "#define %s %d\n", defname, value ); add_action( buf ); } --- 46,52 ---- return; } ! snprintf( buf, sizeof buf, "#define %s %d\n", defname, value ); add_action( buf ); } *************** *** 364,370 **** int arg; { char errmsg[MAXLINE]; ! (void) sprintf( errmsg, msg, arg ); flexerror( errmsg ); } --- 364,370 ---- int arg; { char errmsg[MAXLINE]; ! (void) snprintf( errmsg, sizeof errmsg, msg, arg ); flexerror( errmsg ); } *************** *** 376,382 **** { char errmsg[MAXLINE]; ! (void) sprintf( errmsg, msg, arg ); flexerror( errmsg ); } --- 376,382 ---- { char errmsg[MAXLINE]; ! (void) snprintf( errmsg, sizeof errmsg, msg, arg ); flexerror( errmsg ); } *************** *** 414,427 **** *s2 = '\0'; if ( do_infile ) ! sprintf( directive, line_fmt, linenum, filename ); else { if ( output_file == stdout ) /* Account for the line directive itself. */ ++out_linenum; ! sprintf( directive, line_fmt, out_linenum, filename ); } /* If output_file is nil then we should put the directive in --- 414,429 ---- *s2 = '\0'; if ( do_infile ) ! snprintf( directive, sizeof directive, line_fmt, ! linenum, filename ); else { if ( output_file == stdout ) /* Account for the line directive itself. */ ++out_linenum; ! snprintf( directive, sizeof directive, line_fmt, ! out_linenum, filename ); } /* If output_file is nil then we should put the directive in *************** *** 733,740 **** #endif default: ! (void) sprintf( rform, "\\%.3o", ! (unsigned int) c ); return rform; } } --- 735,742 ---- #endif default: ! (void) snprintf( rform, sizeof rform, ! "\\%.3o", (unsigned int) c ); return rform; } }