diff options
Diffstat (limited to 'cutils.c')
-rw-r--r-- | cutils.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -109,6 +109,19 @@ int stristart(const char *str, const char *val, const char **ptr) return 1; } +/* XXX: use host strnlen if available ? */ +int qemu_strnlen(const char *s, int max_len) +{ + int i; + + for(i = 0; i < max_len; i++) { + if (s[i] == '\0') { + break; + } + } + return i; +} + time_t mktimegm(struct tm *tm) { time_t t; |