projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
make m_dupstr return NULL if the string was empty.
[apps/madmutt.git]
/
lib-lib
/
str.h
diff --git
a/lib-lib/str.h
b/lib-lib/str.h
index
4ef9d48
..
8850830
100644
(file)
--- a/
lib-lib/str.h
+++ b/
lib-lib/str.h
@@
-37,7
+37,8
@@
static inline ssize_t m_strnlen(const char *s, ssize_t n) {
}
static inline char *m_strdup(const char *s) {
- return p_dupstr(s, m_strlen(s));
+ ssize_t len = m_strlen(s);
+ return len ? p_dup(s, len + 1) : NULL;
}
static inline int m_strcmp(const char *a, const char *b) {