aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-31 03:21:46 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-31 03:21:46 +0000
commitce3f46e52475daccbc1348ad05a43f99f5fb57ac (patch)
treec717799c4b3863d28d43c21f7f51ab5cde80c668
parentf1f0ac1b7065c152478853052472b0ce8de7be50 (diff)
downloadfetchmail-ce3f46e52475daccbc1348ad05a43f99f5fb57ac.tar.gz
fetchmail-ce3f46e52475daccbc1348ad05a43f99f5fb57ac.tar.bz2
fetchmail-ce3f46e52475daccbc1348ad05a43f99f5fb57ac.zip
Anither step towards reducing malloc calls.
svn path=/trunk/; revision=850
-rw-r--r--driver.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/driver.c b/driver.c
index 2b92ad01..9cdf0939 100644
--- a/driver.c
+++ b/driver.c
@@ -433,7 +433,7 @@ char *realname; /* real name of host */
oldlen = 0;
for (;;)
{
- char *bufp, *line;
+ char *line;
line = xmalloc(sizeof(buf));
line[0] = '\0';
@@ -473,55 +473,55 @@ char *realname; /* real name of host */
if (!ctl->no_rewrite)
reply_hack(line, realname);
- bufp = line;
if (!headers)
{
- oldlen = strlen(bufp);
+ oldlen = strlen(line);
headers = xmalloc(oldlen + 1);
- (void) strcpy(headers, bufp);
- bufp = headers;
+ (void) strcpy(headers, line);
+ free(line);
+ line = headers;
}
else
{
int newlen;
- newlen = oldlen + strlen(bufp);
+ newlen = oldlen + strlen(line);
headers = realloc(headers, newlen + 1);
if (headers == NULL)
return(PS_IOERR);
- strcpy(headers + oldlen, bufp);
- bufp = headers + oldlen;
+ strcpy(headers + oldlen, line);
+ free(line);
+ line = headers + oldlen;
oldlen = newlen;
}
- free(line);
- if (from_offs == -1 && !strncasecmp("From:", bufp, 5))
- from_offs = (bufp - headers);
- else if (from_offs == -1 && !strncasecmp("Resent-From:", bufp, 12))
- from_offs = (bufp - headers);
- else if (from_offs == -1 && !strncasecmp("Apparently-From:", bufp, 16))
- from_offs = (bufp - headers);
+ if (from_offs == -1 && !strncasecmp("From:", line, 5))
+ from_offs = (line - headers);
+ else if (from_offs == -1 && !strncasecmp("Resent-From:", line, 12))
+ from_offs = (line - headers);
+ else if (from_offs == -1 && !strncasecmp("Apparently-From:", line, 16))
+ from_offs = (line - headers);
- else if (!strncasecmp("To:", bufp, 3))
- to_offs = (bufp - headers);
+ else if (!strncasecmp("To:", line, 3))
+ to_offs = (line - headers);
else if (env_offs == -1 && !strncasecmp(ctl->server.envelope,
- bufp,
+ line,
strlen(ctl->server.envelope)))
- env_offs = (bufp - headers);
+ env_offs = (line - headers);
- else if (!strncasecmp("Cc:", bufp, 3))
- cc_offs = (bufp - headers);
+ else if (!strncasecmp("Cc:", line, 3))
+ cc_offs = (line - headers);
- else if (!strncasecmp("Bcc:", bufp, 4))
- bcc_offs = (bufp - headers);
+ else if (!strncasecmp("Bcc:", line, 4))
+ bcc_offs = (line - headers);
- else if (!strncasecmp("Content-Transfer-Encoding:", bufp, 26))
- ctt_offs = (bufp - headers);
+ else if (!strncasecmp("Content-Transfer-Encoding:", line, 26))
+ ctt_offs = (line - headers);
#ifdef HAVE_RES_SEARCH
- else if (MULTIDROP(ctl) && !received_for && !strncasecmp("Received:", bufp, 9))
- received_for = parse_received(ctl, bufp);
+ else if (MULTIDROP(ctl) && !received_for && !strncasecmp("Received:", line, 9))
+ received_for = parse_received(ctl, line);
#endif /* HAVE_RES_SEARCH */
}