mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
various: drop unnecessary DISABLE_WARNING_FORMAT_NONLITERAL
We use _printf_ for these functions, so there shouldn't be a warning in the first place.
This commit is contained in:
@@ -9,14 +9,12 @@
|
||||
#include "macro.h"
|
||||
|
||||
_printf_(3, 4)
|
||||
static inline char *snprintf_ok(char *buf, size_t len, const char *format, ...) {
|
||||
static inline char* snprintf_ok(char *buf, size_t len, const char *format, ...) {
|
||||
va_list ap;
|
||||
int r;
|
||||
|
||||
va_start(ap, format);
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||
r = vsnprintf(buf, len, format, ap);
|
||||
REENABLE_WARNING;
|
||||
va_end(ap);
|
||||
|
||||
return r >= 0 && (size_t) r < len ? buf : NULL;
|
||||
|
||||
@@ -1084,9 +1084,7 @@ int pty_forward_set_titlef(PTYForward *f, const char *format, ...) {
|
||||
return -EBUSY;
|
||||
|
||||
va_start(ap, format);
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL;
|
||||
r = vasprintf(&title, format, ap);
|
||||
REENABLE_WARNING;
|
||||
va_end(ap);
|
||||
if (r < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user