char *buf = line;
int ch;
size_t offset = 0;
+ size_t len = 0;
FOREVER
{
return (line);
}
- buf += strlen (buf) - 1;
+ len = mutt_strlen (buf);
+ if (! len)
+ return (line);
+
+ buf += len - 1;
if (*buf == '\n')
{
/* we did get a full line. remove trailing space */
char email[STRING];
int ret = -1, count = 0;
pid_t thepid;
+ size_t len = 0;
mutt_mktemp (tmpfname, sizeof (tmpfname));
if ((fperr = safe_fopen (tmpfname, "w+")) == NULL)
while ((fgets (email, sizeof (email), fpout)))
{
- *(email + mutt_strlen (email)-1) = '\0';
+ len = mutt_strlen (email);
+ if (len)
+ *(email + len - 1) = '\0';
if(mutt_strncasecmp (email, mailbox, mutt_strlen (mailbox)) == 0)
ret=1;
rewind (fpout);
while ((fgets (email, sizeof (email), fpout)))
{
- *(email + mutt_strlen (email) - 1) = '\0';
+ len = mutt_strlen (email);
+ if (len)
+ *(email + len - 1) = '\0';
(*buffer)[count] = safe_calloc(1, mutt_strlen (email) + 1);
strncpy((*buffer)[count], email, mutt_strlen (email));
count++;
while (fgets (buf, sizeof (buf) - 1, fp))
{
buflen = mutt_strlen (buf);
- term = buf[buflen-1] == '\n';
- if (buflen && buf[buflen-1] == '\n'
- && (buflen == 1 || buf[buflen - 2] != '\r'))
+ term = buflen && buf[buflen-1] == '\n';
+ if (term && (buflen == 1 || buf[buflen - 2] != '\r'))
snprintf (buf + buflen - 1, sizeof (buf) - buflen + 1, "\r\n");
if (buf[0] == '.')
{