]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix strlcpy_safe return value
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 14 Sep 2018 16:27:36 +0000 (17:27 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 14 Sep 2018 16:27:36 +0000 (17:27 +0100)
src/libutil/str_util.c

index 7ff2d9ae79ec2fc5d61b76e5564403241e7fabe4..09817a34417d3b5f882b4f6966bf015925f10fdd 100644 (file)
@@ -374,13 +374,13 @@ rspamd_strlcpy_fast (gchar *dst, const gchar *src, gsize siz)
 size_t
 rspamd_strlcpy_safe (gchar *dst, const gchar *src, gsize siz)
 {
-       const gchar *osrc = src;
        gchar *d = dst;
        gsize nleft = siz;
 
        if (nleft != 0) {
                while (--nleft != 0) {
                        if ((*d++ = *src++) == '\0') {
+                               d --;
                                break;
                        }
                }