diff options
Diffstat (limited to 'cutils.c')
| -rw-r--r-- | cutils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cutils.c b/cutils.c index e2bc1b89df..9d4c570939 100644 --- a/cutils.c +++ b/cutils.c @@ -28,6 +28,13 @@ #include "qemu_socket.h" #include "iov.h" +void strpadcpy(char *buf, int buf_size, const char *str, char pad) +{ + int len = qemu_strnlen(str, buf_size); + memcpy(buf, str, len); + memset(buf + len, pad, buf_size - len); +} + void pstrcpy(char *buf, int buf_size, const char *str) { int c; |