summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-02 21:28:19 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-02 21:28:19 +0100
commitb7ce6b592d8908d378904323a4a6670bfe0b7ab1 (patch)
tree01b139e18460f1de726fab053ea540fb0998a4e4
parent6e1bf7ab998e30b23202192b5b47c119e7a3697d (diff)
macro: document that DECIMAL_STR_MAX contains space for the trailing NUL byte
-rw-r--r--src/shared/macro.h3
1 files changed, 2 insertions, 1 deletions
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 : \