]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Use WIDTHOF() instead of its expansion
authorAlejandro Colomar <alx@kernel.org>
Wed, 18 Jan 2023 11:40:01 +0000 (12:40 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 28 Jan 2023 03:48:37 +0000 (21:48 -0600)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
libmisc/idmapping.c

index 64985f82c88b013880ee57e86fedffb5f71c0c4c..57e9ab229f9ad12106945bb6e65a074340a37455 100644 (file)
@@ -99,7 +99,7 @@ struct map_range *get_map_ranges(int ranges, int argc, char **argv)
  *  8bytes --> 21 ascii estimated -> 18446744073709551616 (20 real)
  * 16bytes --> 39 ascii estimated -> 340282366920938463463374607431768211456 (39 real)
  */
-#define ULONG_DIGITS ((((sizeof(unsigned long) * CHAR_BIT) + 9)/10)*3)
+#define ULONG_DIGITS (((WIDTHOF(unsigned long) + 9)/10)*3)
 
 #if HAVE_SYS_CAPABILITY_H
 static inline bool maps_lower_root(int cap, int ranges, const struct map_range *mappings)