summaryrefslogtreecommitdiff
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-03-24 17:33:54 -0400
commit0a8d98285f46f721dabf38485df916c02d6a4675 (patch)
tree3bed6854f85fc9b5e7d6e903a1ac2fb33ac5262c
parentdab441aea240f3b7c18a26d2ef51979ea36c301c (diff)
downloadmusl-0a8d98285f46f721dabf38485df916c02d6a4675.tar.gz
musl-0a8d98285f46f721dabf38485df916c02d6a4675.tar.bz2
musl-0a8d98285f46f721dabf38485df916c02d6a4675.tar.xz
musl-0a8d98285f46f721dabf38485df916c02d6a4675.zip
fix confstr return value
per the specification, the terminating null byte is counted.
-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;
}