diff options
Diffstat (limited to 'libbb')
-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 329b0237e..7913353e2 100644 --- a/libbb/platform.c +++ b/libbb/platform.c | |||
@@ -166,6 +166,18 @@ char* FAST_FUNC stpcpy(char *p, const char *to_add) | |||
166 | } | 166 | } |
167 | #endif | 167 | #endif |
168 | 168 | ||
169 | #ifndef HAVE_STPNCPY | ||
170 | char* FAST_FUNC stpncpy(char *p, const char *to_add, size_t n) | ||
171 | { | ||
172 | while (n != 0 && (*p = *to_add) != '\0') { | ||
173 | p++; | ||
174 | to_add++; | ||
175 | n--; | ||
176 | } | ||
177 | return p; | ||
178 | } | ||
179 | #endif | ||
180 | |||
169 | #ifndef HAVE_GETLINE | 181 | #ifndef HAVE_GETLINE |
170 | ssize_t FAST_FUNC getline(char **lineptr, size_t *n, FILE *stream) | 182 | ssize_t FAST_FUNC getline(char **lineptr, size_t *n, FILE *stream) |
171 | { | 183 | { |