diff options
| -rw-r--r-- | coreutils/dd.c | 12 | ||||
| -rw-r--r-- | include/libbb.h | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 8bb782781..7a64c3513 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -272,12 +272,6 @@ static bool write_and_stats(const void *buf, size_t len, size_t obs, return 1; } -#if ENABLE_LFS -# define XATOU_SFX xatoull_sfx -#else -# define XATOU_SFX xatoul_sfx -#endif - #if ENABLE_FEATURE_DD_IBS_OBS static int parse_comma_flags(char *val, const char *words, const char *error_in) { @@ -457,15 +451,15 @@ int dd_main(int argc UNUSED_PARAM, char **argv) /* These can be large: */ if (what == OP_count) { G.flags |= FLAG_COUNT; - count = XATOU_SFX(val, cwbkMG_suffixes); + count = XATOOFF_SFX(val, cwbkMG_suffixes); /*continue;*/ } if (what == OP_seek) { - seek = XATOU_SFX(val, cwbkMG_suffixes); + seek = XATOOFF_SFX(val, cwbkMG_suffixes); /*continue;*/ } if (what == OP_skip) { - skip = XATOU_SFX(val, cwbkMG_suffixes); + skip = XATOOFF_SFX(val, cwbkMG_suffixes); /*continue;*/ } if (what == OP_if) { diff --git a/include/libbb.h b/include/libbb.h index 4b3319824..8d252d455 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -290,6 +290,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN /* "long" is long enough on this system */ typedef unsigned long uoff_t; # define XATOOFF(a) xatoul_range((a), 0, LONG_MAX) +# define XATOOFF_SFX(a, s) xatoul_range_sfx((a), 0, LONG_MAX, s) /* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */ # define BB_STRTOOFF bb_strtoul # define STRTOOFF strtoul @@ -299,6 +300,7 @@ typedef unsigned long uoff_t; /* "long" is too short, need "long long" */ typedef unsigned long long uoff_t; # define XATOOFF(a) xatoull_range((a), 0, LLONG_MAX) +# define XATOOFF_SFX(a, s) xatoull_range_sfx((a), 0, LLONG_MAX, s) # define BB_STRTOOFF bb_strtoull # define STRTOOFF strtoull # define OFF_FMT "ll" @@ -314,12 +316,14 @@ typedef unsigned long long uoff_t; # if UINT_MAX == ULONG_MAX typedef unsigned long uoff_t; # define XATOOFF(a) xatoi_positive(a) +# define XATOOFF_SFX(a, s) xatoul_range_sfx((a), 0, INT_MAX, s) # define BB_STRTOOFF bb_strtou # define STRTOOFF strtol # define OFF_FMT "l" # else typedef unsigned long uoff_t; # define XATOOFF(a) xatoul_range((a), 0, LONG_MAX) +# define XATOOFF_SFX(a, s) xatoul_range_sfx((a), 0, LONG_MAX, s) # define BB_STRTOOFF bb_strtoul # define STRTOOFF strtol # define OFF_FMT "l" |
