From 36f8dbf75ab77aa6fe3be18d90b330bb6aa968e6 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 2 Sep 2003 20:20:54 +0000 Subject: [PATCH] fix a buffer overflow (ouch) --- tools/qfbsp/source/map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/qfbsp/source/map.c b/tools/qfbsp/source/map.c index afe42fce0..df2ed213f 100644 --- a/tools/qfbsp/source/map.c +++ b/tools/qfbsp/source/map.c @@ -37,6 +37,7 @@ static __attribute__ ((unused)) const char rcsid[] = #include "QF/dstring.h" #include "QF/quakefs.h" #include "QF/sys.h" +#include "QF/va.h" #include "bsp5.h" @@ -616,7 +617,6 @@ void WriteEntitiesToString (void) { dstring_t *buf; - char line[128]; epair_t *ep; int i; @@ -630,8 +630,8 @@ WriteEntitiesToString (void) dstring_appendstr (buf, "{\n"); for (ep = entities[i].epairs; ep; ep = ep->next) { - sprintf (line, "\"%s\" \"%s\"\n", ep->key, ep->value); - dstring_appendstr (buf, line); + dstring_appendstr (buf, va ("\"%s\" \"%s\"\n", + ep->key, ep->value)); } dstring_appendstr (buf, "}\n"); }