diff options
author | Denys Vlasenko | 2021-02-18 13:44:27 +0100 |
---|---|---|
committer | Denys Vlasenko | 2021-02-18 13:45:49 +0100 |
commit | 33745b1fc8cc6d41f4e708d67800d296668af2ce (patch) | |
tree | 613c65a05046c60cdd0f786434c2c55b2e2e8d1b /libbb/platform.c | |
parent | 666a9a4c4d90c70e91272e72dcf3592410f1b5d0 (diff) | |
download | busybox-33745b1fc8cc6d41f4e708d67800d296668af2ce.zip busybox-33745b1fc8cc6d41f4e708d67800d296668af2ce.tar.gz |
ash: placate -Werror=format-security
"In function 'sprint_status48':
error: format not a string literal and no format arguments"
function old new delta
sprint_status48 160 158 -2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/platform.c')
-rw-r--r-- | libbb/platform.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libbb/platform.c b/libbb/platform.c index 329b023..7913353 100644 --- a/libbb/platform.c +++ b/libbb/platform.c @@ -166,6 +166,18 @@ char* FAST_FUNC stpcpy(char *p, const char *to_add) } #endif +#ifndef HAVE_STPNCPY +char* FAST_FUNC stpncpy(char *p, const char *to_add, size_t n) +{ + while (n != 0 && (*p = *to_add) != '\0') { + p++; + to_add++; + n--; + } + return p; +} +#endif + #ifndef HAVE_GETLINE ssize_t FAST_FUNC getline(char **lineptr, size_t *n, FILE *stream) { |