Mercurial > hg > th-libs
comparison th_string.c @ 346:691f3ad00943
Remove th_strlen() again. I suppose UTF8 aware functions would make sense at
some point, though.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 24 Feb 2016 01:33:33 +0200 |
parents | 14aaa9bf4ea5 |
children | b040dc0f77cf |
comparison
equal
deleted
inserted
replaced
345:d5e5f6019584 | 346:691f3ad00943 |
---|---|
5 * | 5 * |
6 * Please read file 'COPYING' for information on license and distribution. | 6 * Please read file 'COPYING' for information on license and distribution. |
7 */ | 7 */ |
8 #include "th_util.h" | 8 #include "th_util.h" |
9 #include "th_string.h" | 9 #include "th_string.h" |
10 | |
11 | |
12 /* Implementation of strdup() with a NULL check | |
13 */ | |
14 size_t th_strlen(const char *str) | |
15 { | |
16 size_t len; | |
17 assert(str != NULL); | |
18 | |
19 for (len = 0; *str; str++) len++; | |
20 | |
21 return len; | |
22 } | |
23 | 10 |
24 | 11 |
25 /* Implementation of strdup() with a NULL check | 12 /* Implementation of strdup() with a NULL check |
26 */ | 13 */ |
27 char *th_strdup(const char *src) | 14 char *th_strdup(const char *src) |