diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-03-20 03:15:03 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-03-20 23:00:09 +0100 |
commit | 9a17484d986f6cb8828afdf911db425b574c63fd (patch) | |
tree | 878d64b9079ae9dfd878be7362d58e49128db4cd /src/shared/util.c | |
parent | 5407f2dea3efa5234140f1adb9c2be9916d77cdc (diff) |
bus: implement demarshaller
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index f94abbcc02..69f1b00934 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -5797,3 +5797,22 @@ char *strextend(char **x, ...) { return r + l; } + +char *strrep(const char *s, unsigned n) { + size_t l; + char *r, *p; + unsigned i; + + assert(s); + + l = strlen(s); + p = r = malloc(l * n + 1); + if (!r) + return NULL; + + for (i = 0; i < n; i++) + p = stpcpy(p, s); + + *p = 0; + return r; +} |