chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e1bf7a
)
macro: document that DECIMAL_STR_MAX contains space for the trailing NUL byte
author
Lennart Poettering
<lennart@poettering.net>
Mon, 2 Feb 2015 20:28:19 +0000
(21:28 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 2 Feb 2015 20:28:19 +0000
(21:28 +0100)
src/shared/macro.h
patch
|
blob
|
history
diff --git
a/src/shared/macro.h
b/src/shared/macro.h
index e88630fa04deab1dbce89a0f2668b1758637f0b6..7f89951d62e00ee5f68809e017c2572f1e174770 100644
(file)
--- 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 : \