Mercurial > libedl
comparison src/util.c @ 14:2d7c810a1ac2 default tip
*: misc. cleanup
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Fri, 03 May 2024 22:40:28 -0400 |
parents | d6f8f73a0c50 |
children |
comparison
equal
deleted
inserted
replaced
13:41b74137e201 | 14:2d7c810a1ac2 |
---|---|
6 /* reimplementations of non-portable stdlib functions */ | 6 /* reimplementations of non-portable stdlib functions */ |
7 | 7 |
8 size_t EDL_internal_strnlen(const char* s, size_t maxlen) { | 8 size_t EDL_internal_strnlen(const char* s, size_t maxlen) { |
9 size_t len; | 9 size_t len; |
10 | 10 |
11 for (len = 0; len < maxlen; len++, s++) { | 11 for (len = 0; len < maxlen; len++, s++) |
12 if (!*s) | 12 if (!*s) |
13 break; | 13 break; |
14 } | |
15 | 14 |
16 return len; | 15 return len; |
17 } | 16 } |
18 | 17 |
19 char* EDL_internal_strnchr(const char* haystack, char needle, size_t length) { | 18 char* EDL_internal_strnchr(const char* haystack, char needle, size_t length) { |