linuxkpi: Add strscpy_pad()
to <linux/string.h>
It's the same as `strscpy()` except that it fills the rest of the destination buffer with zeroes if the source buffer is shorter. Reviewed by: manu Approved by: manu
This commit is contained in:
parent
4dac88cd15
commit
b1a9e570fe
@ -207,6 +207,15 @@ strscpy(char* dst, const char* src, size_t len)
|
||||
return (-E2BIG);
|
||||
}
|
||||
|
||||
static inline ssize_t
|
||||
strscpy_pad(char* dst, const char* src, size_t len)
|
||||
{
|
||||
|
||||
bzero(dst, len);
|
||||
|
||||
return (strscpy(dst, src, len));
|
||||
}
|
||||
|
||||
static inline void *
|
||||
memset32(uint32_t *b, uint32_t c, size_t len)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user