tree-wide: use xsprintf() where applicable

Also add a coccinelle receipt to help with such transitions.
This commit is contained in:
Daniel Mack
2016-01-12 15:36:32 +01:00
parent 1f52a79d4e
commit d054f0a4d4
21 changed files with 70 additions and 40 deletions
+2 -2
View File
@@ -352,7 +352,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_SET_STRING(iovec[n++], location);
}
@@ -777,7 +777,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;