l10n: ko.po: Add Korean translation
[gitweb.git] / compat / inet_ntop.c
index 90b7cc45f33411bbc39cd731ca3e43288cb40b69..68307262be04955993590e32daecc08fcf7eda60 100644 (file)
@@ -53,11 +53,11 @@ inet_ntop4(const u_char *src, char *dst, size_t size)
        nprinted = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
        if (nprinted < 0)
                return (NULL);  /* we assume "errno" was set by "snprintf()" */
-       if ((size_t)nprinted > size) {
+       if ((size_t)nprinted >= size) {
                errno = ENOSPC;
                return (NULL);
        }
-       strcpy(dst, tmp);
+       strlcpy(dst, tmp, size);
        return (dst);
 }
 
@@ -154,7 +154,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
                errno = ENOSPC;
                return (NULL);
        }
-       strcpy(dst, tmp);
+       strlcpy(dst, tmp, size);
        return (dst);
 }
 #endif