From: Pierre Habouzit Date: Fri, 1 Dec 2006 22:54:28 +0000 (+0100) Subject: more nonnull attributes. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=693bfbaf2d595042ed12eea010bf01bb0ea9c125;p=apps%2Fmadmutt.git more nonnull attributes. simplify skipspaces as !isspace('\0') holds Signed-off-by: Pierre Habouzit --- diff --git a/lib-lib/str.h b/lib-lib/str.h index 3133585..882a103 100644 --- a/lib-lib/str.h +++ b/lib-lib/str.h @@ -344,23 +344,27 @@ m_strncat(char *dst, ssize_t n, const char *src, ssize_t l) { /* parsing related */ /****************************************************************************/ +__attribute__((nonnull(1))) static inline const char *m_strchrnul(const char *s, int c) { while (*s && *s != c) s++; return s; } +__attribute__((nonnull(1))) static inline const char *m_strnextsp(const char *s) { while (*s && !isspace((unsigned char)*s)) s++; return s; } +__attribute__((nonnull(1))) static inline const char *skipspaces(const char *s) { - while (*s && isspace((unsigned char)*s)) + while (isspace((unsigned char)*s)) s++; return s; } +__attribute__((nonnull(1))) static inline char *vskipspaces(const char *s) { return (char *)skipspaces(s); }