From: Alejandro Colomar Date: Sun, 16 Mar 2025 20:56:25 +0000 (+0100) Subject: lib/string/: seprintf(), stpecpy(): Add missing const X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac46a34638976d0c1b5e219068ed623f9c2dfac4;p=thirdparty%2Fshadow.git lib/string/: seprintf(), stpecpy(): Add missing const Reported-by: Christopher Bazley Signed-off-by: Alejandro Colomar --- diff --git a/lib/string/sprintf/seprintf.c b/lib/string/sprintf/seprintf.c index 3be154fe7..2fdfdfbf9 100644 --- a/lib/string/sprintf/seprintf.c +++ b/lib/string/sprintf/seprintf.c @@ -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 diff --git a/lib/string/sprintf/seprintf.h b/lib/string/sprintf/seprintf.h index e1a263780..b2059fb26 100644 --- a/lib/string/sprintf/seprintf.h +++ b/lib/string/sprintf/seprintf.h @@ -18,17 +18,18 @@ #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; diff --git a/lib/string/strcpy/stpecpy.c b/lib/string/strcpy/stpecpy.c index 2e6f92b0f..878853e79 100644 --- a/lib/string/strcpy/stpecpy.c +++ b/lib/string/strcpy/stpecpy.c @@ -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 diff --git a/lib/string/strcpy/stpecpy.h b/lib/string/strcpy/stpecpy.h index d564d778b..c46346b8f 100644 --- a/lib/string/strcpy/stpecpy.h +++ b/lib/string/strcpy/stpecpy.h @@ -19,13 +19,13 @@ #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;