summaryrefslogtreecommitdiff
path: root/usr.bin/xlint
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-26 02:28:25 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-26 02:28:25 +0000
commitf1bcf4518c8be28e8a779f3a9f5fcefc62e6ea95 (patch)
tree67913398f5ae34197f7cd5ad8baa2095d9ba8cba /usr.bin/xlint
parent06e33d45a328a88d70c4bef50764764e51c54895 (diff)
string cleaning; ok tdeval
Diffstat (limited to 'usr.bin/xlint')
-rw-r--r--usr.bin/xlint/lint1/emit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/xlint/lint1/emit.c b/usr.bin/xlint/lint1/emit.c
index 29d637efe34..d1bff6ad212 100644
--- a/usr.bin/xlint/lint1/emit.c
+++ b/usr.bin/xlint/lint1/emit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: emit.c,v 1.4 2002/02/19 19:39:39 millert Exp $ */
+/* $OpenBSD: emit.c,v 1.5 2003/04/26 02:28:24 deraadt Exp $ */
/* $NetBSD: emit.c,v 1.2 1995/07/03 21:24:00 cgd Exp $ */
/*
@@ -33,7 +33,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: emit.c,v 1.4 2002/02/19 19:39:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: emit.c,v 1.5 2003/04/26 02:28:24 deraadt Exp $";
#endif
#include <stdio.h>
@@ -202,9 +202,10 @@ void
outint(i)
int i;
{
- if ((ob.o_end - ob.o_nxt) < 3 * sizeof (int))
+ if ((ob.o_end - ob.o_nxt) < 12)
outxbuf();
- ob.o_nxt += sprintf(ob.o_nxt, "%d", i);
+ snprintf(ob.o_nxt, ob.o_end - ob.o_nxt, "%d", i);
+ ob.o_nxt += strlen(ob.o_nxt);
}
/*