From: Daniel Lockyer Date: Fri, 24 Nov 2017 10:36:04 +0000 (+0000) Subject: Replace use of snprintf with xsprintf X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6f8ee40d684e4c02211a80c3fa8a8a1e694693af;p=elogind.git Replace use of snprintf with xsprintf --- diff --git a/src/basic/log.c b/src/basic/log.c index 3367f8424..ce96ac443 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -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;