diff --git a/strl.c b/strl.c index 130c36d..ce08fda 100644 --- a/strl.c +++ b/strl.c @@ -93,7 +93,7 @@ strlcpy(char * dst, const char * src, size_t dstsize) /* * perform the size limited copy and NUL terminate */ - if (srclen > dstsize-1) { + if (srclen+1 > dstsize) { memcpy(dst, src, dstsize-1); dst[dstsize-1] = '\0'; #if defined(STRL_TEST)