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:
parent
8a4c0c32f4
commit
4f8d44c220
@ -26,7 +26,8 @@ size_t strlcat(char *dst, const char *src, size_t size)
|
||||
bytes++;
|
||||
}
|
||||
|
||||
*q = '\0';
|
||||
if (size)
|
||||
*q = '\0';
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,8 @@ size_t strlcpy(char *dst, const char *src, size_t size)
|
||||
bytes++;
|
||||
}
|
||||
|
||||
*q = '\0';
|
||||
if (size)
|
||||
*q = '\0';
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
@ -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__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user