struct AliasList a_list = TAILQ_HEAD_INITIALIZER(a_list);
char bestname[8192] = { 0 };
- if (buf[0] != 0) /* avoid empty string as strstr argument */
+ if (buf[0] != '\0') /* avoid empty string as strstr argument */
{
TAILQ_FOREACH(a, &Aliases, entries)
{
}
}
- if (bestname[0] != 0)
+ if (bestname[0] != '\0')
{
if (mutt_str_strcmp(bestname, buf) != 0)
{
bestname[0] = '\0';
mutt_alias_menu(bestname, sizeof(bestname), !TAILQ_EMPTY(&a_list) ? &a_list : &Aliases);
- if (bestname[0] != 0)
+ if (bestname[0] != '\0')
mutt_str_strfcpy(buf, bestname, buflen);
/* free the alias list */
cl = 2; /* skip the index coloring sequence */
cw = 0;
}
- else if ((cw < 0) && (cl == 1) && src[0] && (src[0] < MUTT_TREE_MAX))
+ else if ((cw < 0) && (cl == 1) && (src[0] != '\0') && (src[0] < MUTT_TREE_MAX))
cw = 1;
else if (cw < 0)
cw = 0; /* unprintable wchar */
if (!mutt_regexlist_match(&NoSpamList, line))
{
/* if spam tag already exists, figure out how to amend it */
- if (env->spam && *buf)
+ if (env->spam && (*buf != '\0'))
{
/* If C_SpamSeparator defined, append with separator */
if (C_SpamSeparator)
}
/* spam tag is new, and match expr is non-empty; copy */
- else if (!env->spam && *buf)
+ else if (!env->spam && (*buf != '\0'))
{
env->spam = mutt_buffer_from(buf);
}
if (data & MUTT_NAMED)
{
mutt_extract_token(buf, s, 0);
- if (buf->data && *buf->data)
+ if (buf->data && (*buf->data != '\0'))
{
m->desc = mutt_str_strdup(buf->data);
}
return MUTT_CMD_WARNING;
}
- if (buf->data && *buf->data)
+ if (buf->data && (*buf->data != '\0'))
{
/* Expand and subscribe */
if (imap_subscribe(mutt_expand_path(buf->data, buf->dsize), true) != 0)
char *tag = NULL, *format = NULL;
mutt_extract_token(buf, s, 0);
- if (buf->data && *buf->data)
+ if (buf->data && (*buf->data != '\0'))
tag = mutt_str_strdup(buf->data);
else
continue;
char *tag = NULL, *transform = NULL;
mutt_extract_token(buf, s, 0);
- if (buf->data && *buf->data)
+ if (buf->data && (*buf->data != '\0'))
tag = mutt_str_strdup(buf->data);
else
continue;
return MUTT_CMD_WARNING;
}
- if (buf->data && *buf->data)
+ if (buf->data && (*buf->data != '\0'))
{
/* Expand and subscribe */
if (imap_subscribe(mutt_expand_path(buf->data, buf->dsize), false) != 0)
return 1;
}
- if ((Completed[0] == '\0') && UserTyped[0])
+ if ((Completed[0] == '\0') && (UserTyped[0] != '\0'))
return 0;
/* NumMatched will _always_ be at least 1 since the initial
return 1;
}
- if ((Completed[0] == '\0') && UserTyped[0])
+ if ((Completed[0] == '\0') && (UserTyped[0] != '\0'))
return 0;
/* NumMatched will _always_ be at least 1 since the initial
return 1;
}
- if ((Completed[0] == '\0') && UserTyped[0])
+ if ((Completed[0] == '\0') && (UserTyped[0] != '\0'))
return 0;
/* NumMatched will _always_ be at least 1 since the initial
return true;
}
- if ((Completed[0] == '\0') && UserTyped[0])
+ if ((Completed[0] == '\0') && (UserTyped[0] != '\0'))
return false;
/* NumMatched will _always_ be at least 1 since the initial
return true;
}
- if ((Completed[0] == '\0') && UserTyped[0])
+ if ((Completed[0] == '\0') && (UserTyped[0] != '\0'))
return false;
/* NumMatched will _always_ be at least 1 since the initial
if ((*ptz == '+') || (*ptz == '-'))
{
- if (ptz[1] && ptz[2] && ptz[3] && ptz[4] &&
+ if ((ptz[1] != '\0') && (ptz[2] != '\0') && (ptz[3] != '\0') && (ptz[4] != '\0') &&
isdigit((unsigned char) ptz[1]) && isdigit((unsigned char) ptz[2]) &&
isdigit((unsigned char) ptz[3]) && isdigit((unsigned char) ptz[4]))
{
SKIPWS(buf);
char *start = buf;
- while (*buf && !isspace(*buf))
+ while ((*buf != '\0') && !isspace(*buf))
buf++;
*buf = '\0';
wchar_t *wbuf = *pwbuf;
size_t wbuflen = *pwbuflen;
- while (*buf)
+ while (*buf != '\0')
{
memset(&st, 0, sizeof(st));
for (; (k = mbrtowc(&wc, buf, MB_LEN_MAX, &st)) && k != (size_t)(-1) &&
}
wbuf[i++] = wc;
}
- if (*buf && ((k == (size_t) -1) || (k == (size_t) -2)))
+ if ((*buf != '\0') && ((k == (size_t) -1) || (k == (size_t) -2)))
{
if (i >= wbuflen)
{
buflen--; /* Space for the trailing '\0'. */
- for (; *buf && buflen; buflen--)
+ for (; (*buf != '\0') && buflen; buflen--)
buf++;
for (; *s && buflen; buflen--)
*buf++ = *s++;
for (i = 0; *s && *s != ' ' && i < sizeof(buf) - 1;)
buf[i++] = *s++;
buf[i] = '\0';
- if (*buf)
+ if (*buf != '\0')
{
if ((i > 1) && (buf[i - 1] == '!'))
{
}
}
- return *buf ? 0 : -1;
+ return (*buf != '\0') ? 0 : -1;
}
/**
fprintf(fp, "%*s", KeyInfoPadding[KIP_FINGERPRINT], _(KeyInfoPrompts[KIP_FINGERPRINT]));
if (is_pgp && (strlen(s) == 40))
{
- for (int i = 0; *s && s[1] && s[2] && s[3] && s[4]; s += 4, i++)
+ for (int i = 0; (s[0] != '\0') && (s[1] != '\0') && (s[2] != '\0') &&
+ (s[3] != '\0') && (s[4] != '\0');
+ s += 4, i++)
{
putc(*s, fp);
putc(s[1], fp);
}
else
{
- for (int i = 0; *s && s[1] && s[2]; s += 2, i++)
+ for (int i = 0; (s[0] != '\0') && (s[1] != '\0') && (s[2] != '\0'); s += 2, i++)
{
putc(*s, fp);
putc(s[1], fp);
#endif
if (strcasestr(authinfo, " USER "))
{
- if (*buf)
+ if (*buf != '\0')
mutt_str_strcat(buf, sizeof(buf), " ");
mutt_str_strcat(buf, sizeof(buf), "USER");
}
if (client_len)
{
nntp_log_binbuf(client_out, client_len, "SASL", MUTT_SOCK_LOG_FULL);
- if (*buf)
+ if (*buf != '\0')
mutt_str_strcat(buf, sizeof(buf), " ");
len = strlen(buf);
if (sasl_encode64(client_out, client_len, buf + len,
*/
static bool is_ansi(unsigned char *buf)
{
- while (*buf && (isdigit(*buf) || *buf == ';'))
+ while ((*buf != '\0') && (isdigit(*buf) || *buf == ';'))
buf++;
return *buf == 'm';
}
if (!results)
{
/* Prompt for Query */
- if ((mutt_get_field(_("Query: "), buf, buflen, 0) == 0) && buf[0])
+ if ((mutt_get_field(_("Query: "), buf, buflen, 0) == 0) && (buf[0] != '\0'))
{
results = run_query(buf, 0);
}
{
case OP_QUERY_APPEND:
case OP_QUERY:
- if ((mutt_get_field(_("Query: "), buf, buflen, 0) == 0) && buf[0])
+ if ((mutt_get_field(_("Query: "), buf, buflen, 0) == 0) && (buf[0] != '\0'))
{
struct Query *newresults = run_query(buf, 0);
ch = get_field(buf);
if ((mutt_str_strcasecmp(buf, type) != 0) &&
((mutt_str_strncasecmp(buf, type, btlen) != 0) ||
- ((buf[btlen] != 0) && /* implicit wild */
+ ((buf[btlen] != '\0') && /* implicit wild */
(mutt_str_strcmp(buf + btlen, "/*") != 0)))) /* wildsubtype */
{
continue;