Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions win32/inet.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#include "inet.h"

int inet_aton(const char *cp, struct in_addr *inp) {
inp->s_addr = inet_addr(cp);

if (inp->s_addr == INADDR_NONE) {
if ((inp->s_addr= inet_addr(cp)) == INADDR_NONE) {
return 0;
}

Expand Down
43 changes: 23 additions & 20 deletions win32/sendmail.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
} else if (strlen(host) >= HOST_NAME_LEN) {
*error = BAD_MAIL_HOST;
return FAILURE;
} else {
strcpy(MailHost, host);
}

strcpy(MailHost, host);

if (headers) {
char *pos = NULL;
size_t i;
Expand Down Expand Up @@ -301,22 +301,26 @@ PHPAPI int TSendMail(char *host, int *error, char **error_message,
"and \"smtp_port\" setting in php.ini or use ini_set()",
MailHost, !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port"));
return FAILURE;
} else {
ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc, error_message TSRMLS_CC);
TSMClose();
if (RPath) {
efree(RPath);
}
if (headers) {
efree(headers);
efree(headers_lc);
}
if (ret != SUCCESS) {
*error = ret;
return FAILURE;
}
return SUCCESS;
}

ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc, error_message TSRMLS_CC);
TSMClose();

if (RPath) {
efree(RPath);
}

if (headers) {
efree(headers);
efree(headers_lc);
}

if (ret != SUCCESS) {
*error = ret;
return FAILURE;
}

return SUCCESS;
}

//********************************************************************
Expand Down Expand Up @@ -354,10 +358,9 @@ PHPAPI char *GetSMErrorText(int index)
if (MIN_ERROR_INDEX <= index && index < MAX_ERROR_INDEX) {
return (ErrorMessages[index]);

} else {
return (ErrorMessages[UNKNOWN_ERROR]);

}

return (ErrorMessages[UNKNOWN_ERROR]);
}


Expand Down
17 changes: 7 additions & 10 deletions win32/winutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@ PHPAPI char *php_win32_error_to_msg(int error)
}

int php_win32_check_trailing_space(const char * path, const int path_len) {
if (path_len < 1) {
return 1;
}
if (path) {
if (path[0] == ' ' || path[path_len - 1] == ' ') {
return 0;
} else {
return 1;
}
} else {
if(!path) {
return 0;
}

if ((path_len < 1) || (path[0] != ' ') || (path[path_len - 1] != ' ')) {
return 1;
}

return 0;
}

HCRYPTPROV hCryptProv;
Expand Down