chiark / gitweb /
Replace use of snprintf with xsprintf
authorDaniel Lockyer <thisisdaniellockyer@gmail.com>
Fri, 24 Nov 2017 10:36:04 +0000 (10:36 +0000)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Nov 2017 10:36:04 +0000 (10:36 +0000)
src/basic/log.c

index 3367f8424b2c76b497925d61d155807422af0441..ce96ac443fa20098bf044f8c552606b6be8eb4c1 100644 (file)
@@ -370,7 +370,7 @@ static int write_to_console(
         highlight = LOG_PRI(level) <= LOG_ERR && show_color;
 
         if (show_location) {
-                snprintf(location, sizeof(location), "(%s:%i) ", file, line);
+                xsprintf(location, "(%s:%i) ", file, line);
                 iovec[n++] = IOVEC_MAKE_STRING(location);
         }
 
@@ -813,7 +813,7 @@ static void log_assert(
                 return;
 
         DISABLE_WARNING_FORMAT_NONLITERAL;
-        snprintf(buffer, sizeof buffer, format, text, file, line, func);
+        xsprintf(buffer, format, text, file, line, func);
         REENABLE_WARNING;
 
         log_abort_msg = buffer;