Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> --- cutils.c | 8 ++++++++ qemu-common.h | 1 + 2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/cutils.c b/cutils.c index c91f887..0835834 100644 --- a/cutils.c +++ b/cutils.c @@ -84,6 +84,14 @@ int stristart(const char *str, const char *val, const char **ptr) return 1; } +/* concat first 'offset' chars in 'dest' with 'src' */ +char *strocat(char *buf, const char *src, int offset) +{ + memcpy(&buf[offset], src, strlen(src)); + buf[offset+strlen(src)] = '\0'; + return buf; +} + /* XXX: use host strnlen if available ? */ int qemu_strnlen(const char *s, int max_len) { diff --git a/qemu-common.h b/qemu-common.h index 404c421..0a9b919 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -138,6 +138,7 @@ void pstrcpy(char *buf, int buf_size, const char *str); char *pstrcat(char *buf, int buf_size, const char *s); int strstart(const char *str, const char *val, const char **ptr); int stristart(const char *str, const char *val, const char **ptr); +char *strocat(char *dest, const char *src, int offset); int qemu_strnlen(const char *s, int max_len); time_t mktimegm(struct tm *tm); int qemu_fls(int i); -- 1.7.0.4