aboutsummaryrefslogtreecommitdiff
path: root/fake-lib.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-18 07:03:04 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-18 07:10:17 +0100
commit48919caa7b9fb99ba8196098c0ca2e1b3dae5160 (patch)
tree585312e8c0182016e99d8bb35ba12e1c1115ab09 /fake-lib.c
parent69d886c5757e405785ce811d8622f4ff189a9514 (diff)
downloadwix-on-linux-48919caa7b9fb99ba8196098c0ca2e1b3dae5160.tar.gz
wix-on-linux-48919caa7b9fb99ba8196098c0ca2e1b3dae5160.tar.bz2
wix-on-linux-48919caa7b9fb99ba8196098c0ca2e1b3dae5160.zip
Move dupcat out into its own file, and add dupstr.
Also a handy #define to replace all those tedious castings of NULL.
Diffstat (limited to 'fake-lib.c')
-rw-r--r--fake-lib.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/fake-lib.c b/fake-lib.c
index 36c6198..cf6be49 100644
--- a/fake-lib.c
+++ b/fake-lib.c
@@ -88,28 +88,3 @@ void c16cpy(char16_t *out, uint32_t *outsize, char *s)
88 } 88 }
89 *outsize = retlen; 89 *outsize = retlen;
90} 90}
91
92char *dupcat(const char *str, ...)
93{
94 va_list ap;
95 const char *p;
96 char *out, *outp;
97 size_t len;
98
99 len = 1;
100 va_start(ap, str);
101 for (p = str; p; p = va_arg(ap, const char *))
102 len += strlen(p);
103 va_end(ap);
104
105 out = snewn(len, char);
106 outp = out;
107 va_start(ap, str);
108 for (p = str; p; p = va_arg(ap, const char *)) {
109 strcpy(outp, p);
110 outp += strlen(p);
111 }
112 va_end(ap);
113
114 return out;
115}