From: Christian Brauner Date: Sun, 27 Nov 2016 22:41:06 +0000 (+0100) Subject: utils: add macro __LXC_NUMSTRLEN X-Git-Tag: lxc-1.0.10~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb00d120e6a93b66c071cb5e9bca55bbfd45452b;p=thirdparty%2Flxc.git utils: add macro __LXC_NUMSTRLEN This macro can be used to set or allocate a string buffer that can hold any 64bit representable number. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/utils.h b/src/lxc/utils.h index 6ce68954e..9cb99cd57 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -34,6 +34,10 @@ #include "config.h" #include "initutils.h" +/* Useful macros */ +/* Maximum number for 64 bit integer is a string with 21 digits: 2^64 - 1 = 21 */ +#define __LXC_NUMSTRLEN 21 + /* returns 1 on success, 0 if there were any failures */ extern int lxc_rmdir_onedev(char *path); extern int get_u16(unsigned short *val, const char *arg, int base);