projects
/
apps
/
madmutt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d9960a4
)
make m_dupstr return NULL if the string was empty.
author
Pierre Habouzit
<madcoder@debian.org>
Mon, 30 Oct 2006 16:48:38 +0000
(17:48 +0100)
committer
Pierre Habouzit
<madcoder@debian.org>
Mon, 30 Oct 2006 16:48:38 +0000
(17:48 +0100)
lib-lib/str.h
patch
|
blob
|
history
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) {