Add a simple macro calculating the size needed to store the string representation of an integer type (both signed and unsigned) together with the terminating NUL-character.
Suggested-by: Michael Conrad <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]> --- include/libbb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/libbb.h b/include/libbb.h index 64e8490..0713917 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -297,6 +297,7 @@ struct BUG_off_t_size_is_misdetected { #define SKIP ((int) 2) #define BIT(nr) (1UL << (nr)) +#define INT_BUF_MAX(type) (sizeof(type) * 24 / 10 + 3) /* Macros for min/max. */ #ifndef MIN -- 2.1.4 _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
