X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-lib%2Fstr.h;h=d21e120cb3a7b04ef7c75b57eda3f266000b901a;hb=eed5352e46df93f8921d2e6dfdc95b027bad6e1e;hp=d28c814c807739fe4dd94214e3937f46f25f7116;hpb=d4483b5add8d25008c305b51729f4a53bccfaab8;p=apps%2Fmadmutt.git diff --git a/lib-lib/str.h b/lib-lib/str.h index d28c814..d21e120 100644 --- a/lib-lib/str.h +++ b/lib-lib/str.h @@ -25,12 +25,18 @@ #include "mem.h" +#define NONULL(x) (x?x:"") + static inline ssize_t m_strlen(const char *s) { return s ? strlen(s) : 0; } -static inline char* m_strdup(const char *s) { +static inline char *m_strdup(const char *s) { return p_dupstr(s, m_strlen(s)); } +static inline int m_strcmp(const char *a, const char *b) { + return strcmp(NONULL(a), NONULL(b)); +} + #endif /* MUTT_LIB_LIB_STR_H */