提交 0a8d9828 编写于 作者: T Timo Teräs 提交者: Rich Felker

fix confstr return value

per the specification, the terminating null byte is counted.
上级 dab441ae
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册