macro: document that DECIMAL_STR_MAX contains space for the trailing NUL byte

This commit is contained in:
Lennart Poettering 2015-02-02 21:28:19 +01:00
parent 6e1bf7ab99
commit b7ce6b592d

View file

@ -383,7 +383,8 @@ do { \
/* Returns the number of chars needed to format variables of the
* specified type as a decimal string. Adds in extra space for a
* negative '-' prefix. */
* negative '-' prefix (hence works correctly on signed
* types). Includes space for the trailing NUL. */
#define DECIMAL_STR_MAX(type) \
(2+(sizeof(type) <= 1 ? 3 : \
sizeof(type) <= 2 ? 5 : \