summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-04-26 02:28:24 +0000
committerderaadt <deraadt@openbsd.org>2003-04-26 02:28:24 +0000
commitd4af749bb19d5d71f5f618b4839ac51f268fdaa3 (patch)
treea742651e6bca1fd6e30c3648d25fa7031d44fdbf
parentstring cleaning; ok tedu (diff)
downloadwireguard-openbsd-d4af749bb19d5d71f5f618b4839ac51f268fdaa3.tar.xz
wireguard-openbsd-d4af749bb19d5d71f5f618b4839ac51f268fdaa3.zip
string cleaning; ok tdeval
-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);
}
/*