aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-10-08 15:50:36 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-10-08 15:54:40 +0200
commit049775b2ef39a20dc08a6bf89e2831e8422f7363 (patch)
tree48e5447ceddbbe62a79bec4814deccdaa1945f93
parent84874785c2e226002bb05a42c704ed2d18b99508 (diff)
downloadbusybox-w32-049775b2ef39a20dc08a6bf89e2831e8422f7363.tar.gz
busybox-w32-049775b2ef39a20dc08a6bf89e2831e8422f7363.tar.bz2
busybox-w32-049775b2ef39a20dc08a6bf89e2831e8422f7363.zip
libbb.h: fix logic selecting incorrect BB_STRTOOFF for !LFS configs
BB_STRTOOFF() was equal to bb_strtou(). On x86_64, it's incorrect. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/libbb.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 02cc008f0..b72576f28 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -305,9 +305,13 @@ typedef unsigned long long uoff_t;
305# endif 305# endif
306#else 306#else
307/* CONFIG_LFS is off */ 307/* CONFIG_LFS is off */
308# if UINT_MAX == 0xffffffff 308/* sizeof(off_t) == sizeof(long).
309/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. 309 * May or may not be == sizeof(int). If it is, use xatoi_positive()
310 * gcc will throw warnings on printf("%d", off_t). Crap... */ 310 * and bb_strtou() instead of xatoul_range() and bb_strtoul().
311 * Even if sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway.
312 * gcc will throw warnings on printf("%d", off_t)... Have to use %ld etc.
313 */
314# if UINT_MAX == ULONG_MAX
311typedef unsigned long uoff_t; 315typedef unsigned long uoff_t;
312# define XATOOFF(a) xatoi_positive(a) 316# define XATOOFF(a) xatoi_positive(a)
313# define BB_STRTOOFF bb_strtou 317# define BB_STRTOOFF bb_strtou