From: Lennart Poettering Date: Mon, 2 Feb 2015 20:28:19 +0000 (+0100) Subject: macro: document that DECIMAL_STR_MAX contains space for the trailing NUL byte X-Git-Tag: v219~194 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=b7ce6b592d8908d378904323a4a6670bfe0b7ab1;hp=6e1bf7ab998e30b23202192b5b47c119e7a3697d macro: document that DECIMAL_STR_MAX contains space for the trailing NUL byte --- diff --git a/src/shared/macro.h b/src/shared/macro.h index e88630fa0..7f89951d6 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -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 : \