Merge end-of-December changes from HEAD to u2_10_12_branch.
[ircu2.10.12-pk.git] / ircd / ircd_string.c
index 52caed58499033be7ec450e3716fa186446a5e21..a9d945138aed394032ca597bb9d291b1d79e625f 100644 (file)
@@ -156,6 +156,8 @@ char* ircd_strncpy(char* s1, const char* s2, size_t n)
 
   while (s < endp && (*s++ = *s2++))
     ;
+  if (s == endp)
+    *s = '\0';
   return s1;
 }