Mercurial > hg > nnchat
annotate th_string.c @ 243:589f5e37dd91
Staticize.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 20 Apr 2011 18:54:26 +0300 |
parents | a1ee6c76ca1c |
children | 517c7b22b3c9 |
rev | line source |
---|---|
0 | 1 /* |
2 * Miscellaneous string-handling related utility-functions | |
3 * Programmed and designed by Matti 'ccr' Hamalainen | |
4 * (C) Copyright 2002-2008 Tecnic Software productions (TNSP) | |
5 * | |
6 * Please read file 'COPYING' for information on license and distribution. | |
7 */ | |
8 #ifdef HAVE_CONFIG_H | |
2 | 9 #include "config.h" |
0 | 10 #endif |
11 #include "th_string.h" | |
12 | |
79 | 13 /* strdup with a NULL check |
14 */ | |
15 char *th_strdup(const char *s) | |
16 { | |
81 | 17 char *res; |
18 if (s == NULL) | |
19 return NULL; | |
20 | |
21 if ((res = th_malloc(strlen(s) + 1)) == NULL) | |
22 return NULL; | |
23 | |
24 strcpy(res, s); | |
25 return res; | |
79 | 26 } |
27 | |
28 | |
124 | 29 char *th_strncpy(char * dst, const char * src, const size_t n) |
0 | 30 { |
81 | 31 const char *s = src; |
32 char *d = dst; | |
33 size_t i; | |
34 assert(src != NULL); | |
35 assert(dst != NULL); | |
0 | 36 |
81 | 37 /* Copy to the destination */ |
38 i = n; | |
124 | 39 while (*s && i > 0) { |
81 | 40 *(d++) = *(s++); |
41 i--; | |
42 } | |
0 | 43 |
81 | 44 /* Fill rest of space with zeros */ |
45 while (i > 0) { | |
46 *(d++) = 0; | |
47 i--; | |
48 } | |
0 | 49 |
81 | 50 /* Ensure that last is always zero */ |
51 dst[n - 1] = 0; | |
0 | 52 |
81 | 53 return dst; |
0 | 54 } |
55 | |
56 | |
126 | 57 /* Simulate a sprintf() that allocates memory |
124 | 58 */ |
59 char * th_strdup_vprintf(const char *fmt, va_list args) | |
60 { | |
127 | 61 int size = 100; |
126 | 62 char *buf, *nbuf = NULL; |
124 | 63 |
126 | 64 if ((buf = th_malloc(size)) == NULL) |
65 return NULL; | |
66 | |
67 while (1) { | |
127 | 68 int n = vsnprintf(buf, size, fmt, args); |
126 | 69 if (n > -1 && n < size) |
70 return buf; | |
71 if (n > -1) | |
72 size = n + 1; | |
73 else | |
74 size *= 2; | |
75 | |
76 if ((nbuf = th_realloc(nbuf, size)) == NULL) { | |
77 th_free(buf); | |
78 return NULL; | |
124 | 79 } |
126 | 80 |
81 buf = nbuf; | |
124 | 82 } |
83 } | |
84 | |
85 | |
86 char * th_strdup_printf(const char *fmt, ...) | |
87 { | |
88 char *res; | |
89 va_list ap; | |
90 | |
91 va_start(ap, fmt); | |
92 res = th_strdup_vprintf(fmt, ap); | |
93 va_end(ap); | |
94 | |
95 return res; | |
96 } | |
126 | 97 |
124 | 98 |
99 /* Compare two strings ignoring case [strcasecmp, strncasecmp] | |
100 */ | |
101 int th_strcasecmp(const char * str1, const char * str2) | |
102 { | |
103 const char *s1 = str1, *s2 = str2; | |
81 | 104 assert(str1 != NULL); |
105 assert(str2 != NULL); | |
0 | 106 |
81 | 107 if (str1 == str2) |
108 return 0; | |
0 | 109 |
124 | 110 while (*s1 && *s2 && th_tolower(*s1) == th_tolower(*s2)) { |
81 | 111 s1++; |
112 s2++; | |
113 } | |
0 | 114 |
81 | 115 return (th_tolower(*s1) - th_tolower(*s2)); |
0 | 116 } |
117 | |
118 | |
124 | 119 int th_strncasecmp(const char * str1, const char * str2, size_t n) |
0 | 120 { |
124 | 121 const char *s1 = str1, *s2 = str2; |
81 | 122 assert(str1 != NULL); |
123 assert(str2 != NULL); | |
0 | 124 |
81 | 125 if (str1 == str2) |
126 return 0; | |
0 | 127 |
124 | 128 while (n > 0 && *s1 && *s2 && th_tolower(*s1) == th_tolower(*s2)) { |
81 | 129 s1++; |
130 s2++; | |
131 n--; | |
132 } | |
0 | 133 |
124 | 134 return n > 0 ? (th_tolower(*s1) - th_tolower(*s2)) : 0; |
0 | 135 } |
136 | |
137 | |
138 /* Remove all occurences of control characters, in-place. | |
139 * Resulting string is always shorter or same length than original. | |
140 */ | |
11 | 141 void th_strip_ctrlchars(char * str) |
0 | 142 { |
81 | 143 char *i, *j; |
144 assert(str != NULL); | |
0 | 145 |
81 | 146 i = str; |
147 j = str; | |
148 while (*i) { | |
149 if (!th_iscntrl(*i)) | |
150 *(j++) = *i; | |
151 i++; | |
152 } | |
0 | 153 |
81 | 154 *j = 0; |
0 | 155 } |
156 | |
157 | |
11 | 158 /* Copy a given string over in *result. |
0 | 159 */ |
124 | 160 int th_pstrcpy(char ** result, const char * str) |
0 | 161 { |
81 | 162 assert(result != NULL); |
0 | 163 |
81 | 164 if (str == NULL) |
165 return -1; | |
0 | 166 |
81 | 167 th_free(*result); |
124 | 168 if ((*result = th_malloc(strlen(str) + 1)) == NULL) |
81 | 169 return -2; |
0 | 170 |
81 | 171 strcpy(*result, str); |
172 return 0; | |
0 | 173 } |
174 | |
175 | |
11 | 176 /* Concatenates a given string into string pointed by *result. |
0 | 177 */ |
124 | 178 int th_pstrcat(char ** result, const char * str) |
0 | 179 { |
81 | 180 assert(result != NULL); |
0 | 181 |
81 | 182 if (str == NULL) |
183 return -1; | |
0 | 184 |
81 | 185 if (*result != NULL) { |
124 | 186 *result = th_realloc(*result, strlen(*result) + strlen(str) + 1); |
81 | 187 if (*result == NULL) |
188 return -1; | |
0 | 189 |
81 | 190 strcat(*result, str); |
191 } else { | |
124 | 192 *result = th_malloc(strlen(str) + 1); |
81 | 193 if (*result == NULL) |
194 return -1; | |
0 | 195 |
81 | 196 strcpy(*result, str); |
197 } | |
0 | 198 |
81 | 199 return 0; |
0 | 200 } |
201 | |
202 | |
203 /* Find next non-whitespace character in string. | |
204 * Updates iPos into the position of such character and | |
205 * returns pointer to the string. | |
206 */ | |
124 | 207 const char *th_findnext(const char * str, size_t * pos) |
0 | 208 { |
81 | 209 assert(str != NULL); |
0 | 210 |
81 | 211 /* Terminating NULL-character is not whitespace! */ |
124 | 212 while (th_isspace(str[*pos])) |
213 (*pos)++; | |
214 return &str[*pos]; | |
0 | 215 } |
216 | |
217 | |
124 | 218 /* Find next sep-character from string |
0 | 219 */ |
124 | 220 const char *th_findsep(const char * str, size_t * pos, char sep) |
0 | 221 { |
81 | 222 assert(str != NULL); |
0 | 223 |
124 | 224 while (str[*pos] && str[*pos] != sep) |
225 (*pos)++; | |
226 | |
227 return &str[*pos]; | |
0 | 228 } |
229 | |
230 | |
124 | 231 /* Find next sep- or whitespace from string |
0 | 232 */ |
124 | 233 const char *th_findseporspace(const char * str, size_t * pos, char sep) |
0 | 234 { |
81 | 235 assert(str != NULL); |
0 | 236 |
124 | 237 while (!th_isspace(str[*pos]) && str[*pos] != sep) |
238 (*pos)++; | |
239 | |
240 return &str[*pos]; | |
0 | 241 } |
242 | |
243 | |
244 /* Compare a string to a pattern. Case-SENSITIVE version. | |
245 * The matching pattern can consist of any normal characters plus | |
246 * wildcards ? and *. "?" matches any character and "*" matches | |
247 * any number of characters. | |
248 */ | |
124 | 249 BOOL th_strmatch(const char * str, const char * pattern) |
0 | 250 { |
81 | 251 BOOL didMatch = TRUE, isAnyMode = FALSE, isEnd = FALSE; |
124 | 252 const char *tmpPattern = NULL; |
0 | 253 |
81 | 254 /* Check given pattern and string */ |
255 if (str == NULL || pattern == NULL) | |
256 return FALSE; | |
0 | 257 |
81 | 258 /* Start comparision */ |
259 do { | |
260 didMatch = FALSE; | |
261 switch (*pattern) { | |
262 case '?': | |
263 /* Any single character matches */ | |
264 if (*str) { | |
265 didMatch = TRUE; | |
266 pattern++; | |
267 str++; | |
268 } | |
269 break; | |
0 | 270 |
81 | 271 case '*': |
272 didMatch = TRUE; | |
273 pattern++; | |
274 if (!*pattern) | |
275 isEnd = TRUE; | |
276 isAnyMode = TRUE; | |
277 tmpPattern = pattern; | |
278 break; | |
0 | 279 |
81 | 280 case 0: |
281 if (isAnyMode) { | |
282 if (*str) | |
283 str++; | |
284 else | |
285 isEnd = TRUE; | |
286 } else { | |
287 if (*str) { | |
288 if (tmpPattern) { | |
289 isAnyMode = TRUE; | |
290 pattern = tmpPattern; | |
291 } else | |
292 didMatch = FALSE; | |
293 } else | |
294 isEnd = TRUE; | |
295 } | |
296 break; | |
297 default: | |
298 if (isAnyMode) { | |
299 if (*pattern == *str) { | |
300 isAnyMode = FALSE; | |
301 didMatch = TRUE; | |
302 } else { | |
303 if (*str) { | |
304 didMatch = TRUE; | |
305 str++; | |
306 } | |
307 } | |
308 } else { | |
309 if (*pattern == *str) { | |
310 didMatch = TRUE; | |
311 if (*pattern) | |
312 pattern++; | |
313 if (*str) | |
314 str++; | |
315 } else { | |
316 if (tmpPattern) { | |
317 didMatch = TRUE; | |
318 isAnyMode = TRUE; | |
319 pattern = tmpPattern; | |
320 } | |
321 } | |
322 } | |
0 | 323 |
81 | 324 if (!*str && !*pattern) |
325 isEnd = TRUE; | |
326 break; | |
0 | 327 |
81 | 328 } /* switch */ |
0 | 329 |
81 | 330 } while (didMatch && !isEnd); |
0 | 331 |
81 | 332 return didMatch; |
0 | 333 } |
334 | |
335 | |
336 /* Compare a string to a pattern. Case-INSENSITIVE version. | |
337 */ | |
124 | 338 BOOL th_strcasematch(const char * str, const char * pattern) |
0 | 339 { |
81 | 340 BOOL didMatch = TRUE, isAnyMode = FALSE, isEnd = FALSE; |
124 | 341 const char *tmpPattern = NULL; |
0 | 342 |
81 | 343 /* Check given pattern and string */ |
344 if (str == NULL || pattern == NULL) | |
345 return FALSE; | |
0 | 346 |
81 | 347 /* Start comparision */ |
348 do { | |
349 switch (*pattern) { | |
350 case '?': | |
351 /* Any single character matches */ | |
352 if (*str) { | |
353 pattern++; | |
354 str++; | |
355 } else | |
356 didMatch = FALSE; | |
357 break; | |
0 | 358 |
81 | 359 case '*': |
360 pattern++; | |
361 if (!*pattern || *pattern == '?') | |
362 isEnd = TRUE; | |
363 isAnyMode = TRUE; | |
364 tmpPattern = pattern; | |
365 break; | |
0 | 366 |
81 | 367 case 0: |
368 if (isAnyMode) { | |
369 if (*str) | |
370 str++; | |
371 else | |
372 isEnd = TRUE; | |
373 } else { | |
374 if (*str) { | |
375 if (tmpPattern) { | |
376 isAnyMode = TRUE; | |
377 pattern = tmpPattern; | |
378 } else | |
379 didMatch = FALSE; | |
380 } else | |
381 isEnd = TRUE; | |
382 } | |
383 break; | |
0 | 384 |
81 | 385 default: |
386 if (isAnyMode) { | |
387 if (th_tolower(*pattern) == th_tolower(*str)) { | |
388 isAnyMode = FALSE; | |
389 } else { | |
390 if (*str) | |
391 str++; | |
392 else | |
393 didMatch = FALSE; | |
394 } | |
395 } else { | |
396 if (th_tolower(*pattern) == th_tolower(*str)) { | |
397 if (*pattern) | |
398 pattern++; | |
399 if (*str) | |
400 str++; | |
401 } else { | |
402 if (tmpPattern) { | |
403 isAnyMode = TRUE; | |
404 pattern = tmpPattern; | |
405 } else | |
406 didMatch = FALSE; | |
407 } | |
408 } | |
0 | 409 |
81 | 410 if (!*str && !*pattern) |
411 isEnd = TRUE; | |
412 break; | |
0 | 413 |
81 | 414 } /* switch */ |
0 | 415 |
81 | 416 } while (didMatch && !isEnd); |
0 | 417 |
81 | 418 return didMatch; |
0 | 419 } |
420 | |
131
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
421 |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
422 int th_get_hex_triplet(const char *str) |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
423 { |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
424 const char *p = str; |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
425 int len, val = 0; |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
426 |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
427 for (len = 0; *p && len < 6; p++, len++) { |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
428 if (*p >= '0' && *p <= '9') { |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
429 val *= 16; val += (*p - '0'); |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
430 } else if (*p >= 'A' && *p <= 'F') { |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
431 val *= 16; val += (*p - 'A') + 10; |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
432 } else if (*p >= 'a' && *p <= 'f') { |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
433 val *= 16; val += (*p - 'a') + 10; |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
434 } else |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
435 return -1; |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
436 } |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
437 |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
438 return (len == 6) ? val : -1; |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
439 } |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
440 |
3896861974ac
Added th_get_hex_triplet().
Matti Hamalainen <ccr@tnsp.org>
parents:
127
diff
changeset
|
441 |
243 | 442 static BOOL th_growbuf(char **buf, size_t *bufsize, size_t *len, size_t grow) |
241
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
443 { |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
444 assert(buf != NULL); |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
445 assert(bufsize != NULL); |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
446 assert(len != NULL); |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
447 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
448 if (*buf == NULL) |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
449 *bufsize = 0; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
450 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
451 if (*buf == NULL || *len + grow >= *bufsize) { |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
452 *bufsize += grow + TH_BUFGROW; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
453 *buf = (char *) th_realloc(*buf, *bufsize); |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
454 if (*buf == NULL) |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
455 return FALSE; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
456 } |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
457 return TRUE; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
458 } |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
459 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
460 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
461 void th_vputch(char **buf, size_t *bufsize, size_t *len, const char ch) |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
462 { |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
463 if (!th_growbuf(buf, bufsize, len, 1)) |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
464 return; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
465 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
466 *buf[*len] = ch; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
467 (*len)++; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
468 } |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
469 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
470 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
471 void th_vputs(char **buf, size_t *bufsize, size_t *len, const char *str) |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
472 { |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
473 size_t slen; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
474 if (str == NULL) |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
475 return; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
476 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
477 slen = strlen(str); |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
478 if (!th_growbuf(buf, bufsize, len, slen)) |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
479 return; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
480 |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
481 strcat(*buf + *len, str); |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
482 (*len) += slen; |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
483 } |
a1ee6c76ca1c
Functions for growing a string buffer when needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
484 |