From: Vsevolod Stakhov Date: Sat, 2 Apr 2016 21:22:07 +0000 (+0100) Subject: [Fix] Fix strlcpy startup X-Git-Tag: 1.2.3~79 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b5f2c308cda827342ba231c8cf3f6eaf089495fb;p=rspamd.git [Fix] Fix strlcpy startup --- diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index efffe8cc6..3552caa4e 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -322,7 +322,7 @@ rspamd_strlcpy (gchar *dst, const gchar *src, gsize siz) const gsize *ws; /* Copy as many bytes as will fit */ - if (n != 0) { + if (n-- != 0) { if (((uintptr_t) s & MEM_ALIGN) == ((uintptr_t) d & MEM_ALIGN)) { for (; ((uintptr_t) s & MEM_ALIGN) && n && (*d = *s); n--, s++, d++); if (n && *s) {