From: Sebastian Hammer Date: Wed, 6 Dec 1995 09:51:27 +0000 (+0000) Subject: Fixed the log-prefix buffer - it was too small and the setup code lacked X-Git-Tag: YAZ.1.8~854 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=d6fec902f5ecce2849f1ea7a2fff073df3ea8db9;hp=3daec0c0ae02f6dffeb98fec83913c50de670510 Fixed the log-prefix buffer - it was too small and the setup code lacked a bounds-check. --- diff --git a/util/log.c b/util/log.c index 134d7fd..8102d2b 100644 --- a/util/log.c +++ b/util/log.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: log.c,v $ - * Revision 1.9 1995-09-29 17:12:34 quinn + * Revision 1.10 1995-12-06 09:51:27 quinn + * Fixed the log-prefix buffer - it was too small and the setup code lacked + * a bounds-check. + * + * Revision 1.9 1995/09/29 17:12:34 quinn * Smallish * * Revision 1.8 1995/09/27 15:03:02 quinn @@ -71,7 +75,7 @@ static int l_level = LOG_DEFAULT_LEVEL; static FILE *l_file = stderr; -static char l_prefix[30] = "log"; +static char l_prefix[512] = "log"; static struct { int mask; @@ -107,7 +111,7 @@ void log_init(int level, const char *prefix, const char *name) { l_level = level; if (prefix && *prefix) - strcpy(l_prefix, prefix); + sprintf(l_prefix, "%.512s", prefix); if (!name || !*name || l_file != stderr) return; if (!(l_file = fopen(name, "a")))