projects
/
apps
/
madmutt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
334faeb
)
add m_strchrnul that does what GNU strchrnul does: search for 'c' or
author
Pierre Habouzit
<madcoder@debian.org>
Sun, 12 Nov 2006 12:15:44 +0000
(13:15 +0100)
committer
Pierre Habouzit
<madcoder@debian.org>
Sun, 12 Nov 2006 12:15:44 +0000
(13:15 +0100)
return a pointer on the NUL char if not found
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
lib-lib/str.h
patch
|
blob
|
history
diff --git
a/lib-lib/str.h
b/lib-lib/str.h
index
296cd55
..
603e51b
100644
(file)
--- a/
lib-lib/str.h
+++ b/
lib-lib/str.h
@@
-130,6
+130,12
@@
m_strncat(char *dst, ssize_t n, const char *src, ssize_t l) {
/* parsing related */
/****************************************************************************/
+static inline const char *m_strchrnul(const char *s, int c) {
+ while (*s && *s != c)
+ s++;
+ return s;
+}
+
static inline const char *skipspaces(const char *s) {
while (*s && isspace((unsigned char)*s))
s++;