summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-20 19:58:13 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-20 19:58:54 +0300
commit9b903d3ac3a9ca6d4111210cee73b59354a6a271 (patch)
tree4b18e2dc5527ec1ca87952fe05e484cb45d4c1bb /src
parent7aae8b0769efadbe42cdaed7ea29cfbc22eca7ab (diff)
downloadhercules-9b903d3ac3a9ca6d4111210cee73b59354a6a271.tar.gz
hercules-9b903d3ac3a9ca6d4111210cee73b59354a6a271.tar.bz2
hercules-9b903d3ac3a9ca6d4111210cee73b59354a6a271.tar.xz
hercules-9b903d3ac3a9ca6d4111210cee73b59354a6a271.zip
Add comment to safestrncpy about size checks.
Diffstat (limited to 'src')
-rw-r--r--src/common/strlib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/common/strlib.c b/src/common/strlib.c
index 75ce2a272..df8093456 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -344,6 +344,7 @@ int strlib_config_switch(const char *str) {
}
/// strncpy that always null-terminates the string
+/// @remark this function will read at most `n` - 1 bytes from `src` (from 0 to `n` - 2)
char *strlib_safestrncpy(char *dst, const char *src, size_t n)
{
if( n > 0 )