1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

[PATCH] klibc: strlcpy/strlcat - don't alter destination if size == 0

This commit is contained in:
kay.sievers@vrfy.org 2005-03-28 00:18:49 +02:00 committed by Greg KH
parent 8a4c0c32f4
commit 4f8d44c220
3 changed files with 8 additions and 4 deletions

View File

@ -26,7 +26,8 @@ size_t strlcat(char *dst, const char *src, size_t size)
bytes++;
}
*q = '\0';
if (size)
*q = '\0';
return bytes;
}

View File

@ -19,7 +19,8 @@ size_t strlcpy(char *dst, const char *src, size_t size)
bytes++;
}
*q = '\0';
if (size)
*q = '\0';
return bytes;
}

View File

@ -58,7 +58,8 @@ size_t strlcpy(char *dst, const char *src, size_t size)
bytes++;
}
*q = '\0';
if (size)
*q = '\0';
return bytes;
}
@ -82,7 +83,8 @@ size_t strlcat(char *dst, const char *src, size_t size)
bytes++;
}
*q = '\0';
if (size)
*q = '\0';
return bytes;
}
#endif /* __OWN_STRLCPYCAT__ */