diff options
author | Ron Yorston <rmy@pobox.com> | 2022-01-06 07:46:38 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-01-06 07:46:38 +0000 |
commit | b8751bbc9ac24e71fbe1e79c69074b4c87a134d8 (patch) | |
tree | 336d653df8387b9b1d3c6e46caa373c00cb9b2b2 /libbb/xfuncs_printf.c | |
parent | b15f68214da209b5b293039c09c00f490c0cc193 (diff) | |
parent | 6062c0d19bc201cbeb61b8875598cdd7a14a5ae0 (diff) | |
download | busybox-w32-b8751bbc9ac24e71fbe1e79c69074b4c87a134d8.tar.gz busybox-w32-b8751bbc9ac24e71fbe1e79c69074b4c87a134d8.tar.bz2 busybox-w32-b8751bbc9ac24e71fbe1e79c69074b4c87a134d8.zip |
Merge busybox into merge
Fix merge conflict in miscutils/less.c.
Use exit_SUCCESS() where possible.
Diffstat (limited to 'libbb/xfuncs_printf.c')
-rw-r--r-- | libbb/xfuncs_printf.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index d7d8b1092..aae3b092d 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c | |||
@@ -91,13 +91,10 @@ char* FAST_FUNC xstrdup(const char *s) | |||
91 | 91 | ||
92 | // Die if we can't allocate n+1 bytes (space for the null terminator) and copy | 92 | // Die if we can't allocate n+1 bytes (space for the null terminator) and copy |
93 | // the (possibly truncated to length n) string into it. | 93 | // the (possibly truncated to length n) string into it. |
94 | char* FAST_FUNC xstrndup(const char *s, int n) | 94 | char* FAST_FUNC xstrndup(const char *s, size_t n) |
95 | { | 95 | { |
96 | char *t; | 96 | char *t; |
97 | 97 | ||
98 | if (ENABLE_DEBUG && s == NULL) | ||
99 | bb_simple_error_msg_and_die("xstrndup bug"); | ||
100 | |||
101 | t = strndup(s, n); | 98 | t = strndup(s, n); |
102 | 99 | ||
103 | if (t == NULL) | 100 | if (t == NULL) |
@@ -106,7 +103,7 @@ char* FAST_FUNC xstrndup(const char *s, int n) | |||
106 | return t; | 103 | return t; |
107 | } | 104 | } |
108 | 105 | ||
109 | void* FAST_FUNC xmemdup(const void *s, int n) | 106 | void* FAST_FUNC xmemdup(const void *s, size_t n) |
110 | { | 107 | { |
111 | return memcpy(xmalloc(n), s, n); | 108 | return memcpy(xmalloc(n), s, n); |
112 | } | 109 | } |