diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-24 22:03:46 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-24 22:03:46 +0000 |
commit | e338dd95b45b39a1e3bc307adc98064173a0f9f3 (patch) | |
tree | ffbd0b893c8ba8088a2f034684b9745b49086dd8 /libbb | |
parent | 8942c12782d20367c8816d3cc83c5274735e932a (diff) | |
download | busybox-w32-e338dd95b45b39a1e3bc307adc98064173a0f9f3.tar.gz busybox-w32-e338dd95b45b39a1e3bc307adc98064173a0f9f3.tar.bz2 busybox-w32-e338dd95b45b39a1e3bc307adc98064173a0f9f3.zip |
accumulated post-1.4.0 fixes
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/vdprintf.c | 4 | ||||
-rw-r--r-- | libbb/xfuncs.c | 7 | ||||
-rw-r--r-- | libbb/xreadlink.c | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/libbb/vdprintf.c b/libbb/vdprintf.c index ea2a9d4bf..d16c51947 100644 --- a/libbb/vdprintf.c +++ b/libbb/vdprintf.c | |||
@@ -7,12 +7,8 @@ | |||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <stdio.h> | ||
11 | #include <unistd.h> | ||
12 | #include "libbb.h" | 10 | #include "libbb.h" |
13 | 11 | ||
14 | |||
15 | |||
16 | #if defined(__GLIBC__) && __GLIBC__ < 2 | 12 | #if defined(__GLIBC__) && __GLIBC__ < 2 |
17 | int vdprintf(int d, const char *format, va_list ap) | 13 | int vdprintf(int d, const char *format, va_list ap) |
18 | { | 14 | { |
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index dc160bf5c..c059e41e0 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -81,13 +81,14 @@ char * xstrndup(const char *s, int n) | |||
81 | t = (char*) s; | 81 | t = (char*) s; |
82 | while (m) { | 82 | while (m) { |
83 | if (!*t) break; | 83 | if (!*t) break; |
84 | m--; t++; | 84 | m--; |
85 | t++; | ||
85 | } | 86 | } |
86 | n = n - m; | 87 | n -= m; |
87 | t = xmalloc(n + 1); | 88 | t = xmalloc(n + 1); |
88 | t[n] = '\0'; | 89 | t[n] = '\0'; |
89 | 90 | ||
90 | return memcpy(t,s,n); | 91 | return memcpy(t, s, n); |
91 | } | 92 | } |
92 | 93 | ||
93 | // Die if we can't open a file and return a FILE * to it. | 94 | // Die if we can't open a file and return a FILE * to it. |
diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c index 76f52ca06..fb67cdef1 100644 --- a/libbb/xreadlink.c +++ b/libbb/xreadlink.c | |||
@@ -36,7 +36,7 @@ char *xreadlink(const char *path) | |||
36 | 36 | ||
37 | char *xmalloc_realpath(const char *path) | 37 | char *xmalloc_realpath(const char *path) |
38 | { | 38 | { |
39 | #ifdef __GLIBC__ | 39 | #if defined(__GLIBC__) && !defined(__UCLIBC__) |
40 | /* glibc provides a non-standard extension */ | 40 | /* glibc provides a non-standard extension */ |
41 | return realpath(path, NULL); | 41 | return realpath(path, NULL); |
42 | #else | 42 | #else |