]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
various: drop unnecessary DISABLE_WARNING_FORMAT_NONLITERAL
authorMike Yuan <me@yhndnzj.com>
Sun, 28 Apr 2024 07:59:36 +0000 (15:59 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 28 Apr 2024 11:33:17 +0000 (13:33 +0200)
We use _printf_ for these functions, so there shouldn't
be a warning in the first place.

src/basic/stdio-util.h
src/shared/ptyfwd.c

index 4e93ac90c9ab0d258740c1c0e9db8b379b4f8399..0a2239d02259e65cf494a5f8dc0d70bed0b83f25 100644 (file)
@@ -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 charsnprintf_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;
index 7bd8dd6d89889850cb720106dbcbed184f345ac3..897e39c5338a30f26ff629e0737b806d5eeb56ad 100644 (file)
@@ -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;