about summary refs log tree commit diff
path: root/src/conf
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-02-19 09:40:35 +0200
committerRich Felker <dalias@aerifal.cx>2014-04-16 02:46:04 -0400
commitf96f47d05991f823fbee9812e7630a83b929a88a (patch)
tree458263b1833bd97187aba0c8e8ab508d1efba61c /src/conf
parentf27ca16e9d715d778f48fd27a96bb31d809ecdde (diff)
downloadmusl-f96f47d05991f823fbee9812e7630a83b929a88a.tar.gz
musl-f96f47d05991f823fbee9812e7630a83b929a88a.tar.xz
musl-f96f47d05991f823fbee9812e7630a83b929a88a.zip
fix confstr return value
per the specification, the terminating null byte is counted.

(cherry picked from commit 0a8d98285f46f721dabf38485df916c02d6a4675)
Diffstat (limited to 'src/conf')
-rw-r--r--src/conf/confstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/conf/confstr.c b/src/conf/confstr.c
index 4332f726..6e9c23a0 100644
--- a/src/conf/confstr.c
+++ b/src/conf/confstr.c
@@ -13,5 +13,5 @@ size_t confstr(int name, char *buf, size_t len)
 	}
 	// snprintf is overkill but avoid wasting code size to implement
 	// this completely useless function and its truncation semantics
-	return snprintf(buf, len, "%s", s);
+	return snprintf(buf, len, "%s", s) + 1;
 }