summaryrefslogtreecommitdiff
path: root/lib/smtp.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-11-26 22:58:39 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-11-26 23:31:57 +0000
commit854049f962b7e8826e5ac495783c4ec62e9c19aa (patch)
treef44acaa36db0310f52e02a508c61d54ff7c58682 /lib/smtp.c
parent4bd860a001921e1e007ae448cfdd2c983018c057 (diff)
downloadcurl-854049f962b7e8826e5ac495783c4ec62e9c19aa.tar.gz
smtp: Fixed const'ness of nread parameter in Curl_smtp_escape_eob()
...and some comment typos!
Diffstat (limited to 'lib/smtp.c')
-rw-r--r--lib/smtp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index 2dbd2ea30..d57e62723 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -2308,7 +2308,7 @@ static CURLcode smtp_calc_sasl_details(struct connectdata *conn,
return result;
}
-CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread)
+CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread)
{
/* When sending a SMTP payload we must detect CRLF. sequences making sure
they are sent as CRLF.. instead, as a . on the beginning of a line will
@@ -2323,7 +2323,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread)
char *scratch = data->state.scratch;
char *oldscratch = NULL;
- /* Do we need to allocate the scatch buffer? */
+ /* Do we need to allocate a scratch buffer? */
if(!scratch || data->set.crlf) {
oldscratch = scratch;
@@ -2380,10 +2380,8 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread)
smtp->eob = 0;
}
+ /* Only use the new buffer if we replaced something */
if(si != nread) {
- /* Only use the new buffer if we replaced something */
- nread = si;
-
/* Upload from the new (replaced) buffer instead */
data->req.upload_fromhere = scratch;
@@ -2394,7 +2392,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread)
Curl_safefree(oldscratch);
/* Set the new amount too */
- data->req.upload_present = nread;
+ data->req.upload_present = si;
}
else
Curl_safefree(scratch);