}
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) {
return strcmp(NONULL(a), NONULL(b));
}
+static inline int m_strcasecmp(const char *a, const char *b) {
+ return strcasecmp(NONULL(a), NONULL(b));
+}
+
+static inline int m_strncmp(const char *a, const char *b, size_t n) {
+ return strncmp (NONULL(a), NONULL(b), n);
+}
+
+static inline int m_strncasecmp(const char *a, const char *b, size_t n) {
+ return strncasecmp(NONULL(a), NONULL(b), n);
+}
+
ssize_t m_strcpy(char *dst, ssize_t n, const char *src);
ssize_t m_strncpy(char *dst, ssize_t n, const char *src, ssize_t l);