From b7ce6b592d8908d378904323a4a6670bfe0b7ab1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 2 Feb 2015 21:28:19 +0100 Subject: macro: document that DECIMAL_STR_MAX contains space for the trailing NUL byte --- src/shared/macro.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/macro.h b/src/shared/macro.h index e88630fa04..7f89951d62 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 : \ -- cgit v1.2.3-54-g00ecf