plen = strlen(conn->passwd);
if(2 * ulen + plen + 2 > sizeof plainauth)
- return -1;
+ return 0;
memcpy(plainauth, conn->user, ulen);
plainauth[ulen] = '\0';
if(!ulen) {
*outptr = strdup("=");
- return *outptr? 1: -1;
+ return *outptr? 1: 0;
}
return Curl_base64_encode(conn->data, conn->user, ulen, outptr);
result = CURLE_LOGIN_DENIED; /* Other mechanisms not supported. */
if(!result) {
- if(l <= 0)
+ if(!l)
result = CURLE_OUT_OF_MEMORY;
else if(initresp &&
- l + strlen(mech) <= 512 - 8) { /* AUTH <mech> ...<crlf> */
+ l + strlen(mech) <= 512 - 8) { /* AUTH <mech> ...<crlf> */
result = Curl_pp_sendf(&smtpc->pp, "AUTH %s %s", mech, initresp);
free(initresp);
else {
l = smtp_auth_plain_data(conn, &plainauth);
- if(l <= 0)
+ if(!l)
result = CURLE_OUT_OF_MEMORY;
else {
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", plainauth);
struct SessionHandle *data = conn->data;
size_t plen;
size_t l;
- char * authpasswd;
+ char *authpasswd;
(void)instate; /* no use for this yet */
else {
l = Curl_base64_encode(data, conn->passwd, plen, &authpasswd);
- if(l <= 0)
+ if(!l)
result = CURLE_OUT_OF_MEMORY;
else {
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", authpasswd);
/* Encode it to base64 and send it. */
l = Curl_base64_encode(data, reply, 0, &rplyb64);
- if(l <= 0)
+ if(!l)
result = CURLE_OUT_OF_MEMORY;
else {
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", rplyb64);