]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/string/: seprintf(), stpecpy(): Add missing const
authorAlejandro Colomar <alx@kernel.org>
Sun, 16 Mar 2025 20:56:25 +0000 (21:56 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Fri, 15 May 2026 10:06:49 +0000 (12:06 +0200)
Reported-by: Christopher Bazley <chris.bazley.wg14@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/string/sprintf/seprintf.c
lib/string/sprintf/seprintf.h
lib/string/strcpy/stpecpy.c
lib/string/strcpy/stpecpy.h

index 3be154fe785ad92c55a070b64f2602b6e2ff0920..2fdfdfbf983f864819e6911a6c547745091dcb36 100644 (file)
@@ -10,8 +10,8 @@
 
 
 #if !defined(HAVE_SEPRINTF)
-extern inline char *seprintf(char *dst, char *end, const char *restrict fmt,
-    ...);
-extern inline char *vseprintf(char *dst, char *end, const char *restrict fmt,
-    va_list ap);
+extern inline char *seprintf(char *dst, const char *end,
+    const char *restrict fmt, ...);
+extern inline char *vseprintf(char *dst, const char *end,
+    const char *restrict fmt, va_list ap);
 #endif
index e1a263780241205b6da77925ba776ad609973609..b2059fb2660e4fd073eeccfa798eecb6ec32b8a9 100644 (file)
 #if !defined(HAVE_SEPRINTF)
 // seprintf - string end-pointer print formatted
 format_attr(printf, 3, 4)
-inline char *seprintf(char *dst, char *end, const char *restrict fmt, ...);
+inline char *seprintf(char *dst, const char *end, const char *restrict fmt,
+    ...);
 // vseprintf - va_list string end-pointer print formatted
 format_attr(printf, 3, 0)
-inline char *vseprintf(char *dst, char *end, const char *restrict fmt,
+inline char *vseprintf(char *dst, const char *end, const char *restrict fmt,
     va_list ap);
 #endif
 
 
 #if !defined(HAVE_SEPRINTF)
 inline char *
-seprintf(char *dst, char *end, const char *restrict fmt, ...)
+seprintf(char *dst, const char *end, const char *restrict fmt, ...)
 {
        char     *p;
        va_list  ap;
@@ -44,7 +45,7 @@ seprintf(char *dst, char *end, const char *restrict fmt, ...)
 
 #if !defined(HAVE_SEPRINTF)
 inline char *
-vseprintf(char *dst, char *end, const char *restrict fmt, va_list ap)
+vseprintf(char *dst, const char *end, const char *restrict fmt, va_list ap)
 {
        int        len;
        ptrdiff_t  size;
index 2e6f92b0fcfe682d90a1778a8811f6c4bad6b9b1..878853e79fc16b12623cde0409d0fcb6d8609f56 100644 (file)
@@ -8,5 +8,6 @@
 
 
 #if !defined(HAVE_STPECPY)
-extern inline char *stpecpy(char *dst, char *end, const char *restrict src);
+extern inline char *stpecpy(char *dst, const char *end,
+    const char *restrict src);
 #endif
index d564d778b7c09da237194137b15ebfbdcba70bf8..c46346b8f6efb21484cb3036b063e581f769abf3 100644 (file)
 #if !defined(HAVE_STPECPY)
 // stpecpy - string offset-pointer end-pointer copy
 ATTR_STRING(3)
-inline char *stpecpy(char *dst, char *end, const char *restrict src);
+inline char *stpecpy(char *dst, const char *end, const char *restrict src);
 #endif
 
 
 #if !defined(HAVE_STPECPY)
 inline char *
-stpecpy(char *dst, char *end, const char *restrict src)
+stpecpy(char *dst, const char *end, const char *restrict src)
 {
        bool    trunc;
        char    *p;