From 9b903d3ac3a9ca6d4111210cee73b59354a6a271 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 20 Mar 2017 19:58:13 +0300 Subject: Add comment to safestrncpy about size checks. --- src/common/strlib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') 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 ) -- cgit v1.2.3-60-g2f50