Skip to content

Commit 099c034

Browse files
committed
Fix compilation on WIN (apply the patch from @cmb69)
1 parent f7ddeaf commit 099c034

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ext/standard/mail.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
501501
if (!sendmail_path) {
502502
#ifdef PHP_WIN32
503503
/* handle old style win smtp sending */
504-
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, (char *) subject, (char *) to, (char *) message, NULL, NULL, NULL) == FAILURE) {
504+
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL) == FAILURE) {
505505
if (tsm_errmsg) {
506506
php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
507507
efree(tsm_errmsg);

win32/sendmail.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static zend_string *php_win32_mail_trim_header(char *header)
177177
// See SendText() for additional args!
178178
//********************************************************************/
179179
PHPAPI int TSendMail(char *host, int *error, char **error_message,
180-
char *headers, char *Subject, char *mailTo, char *data,
180+
char *headers, const char *Subject, const char *mailTo, const char *data,
181181
char *mailCc, char *mailBcc, char *mailRPath)
182182
{
183183
int ret;
@@ -352,7 +352,7 @@ PHPAPI char *GetSMErrorText(int index)
352352
// Author/Date: jcar 20/9/96
353353
// History:
354354
//*******************************************************************/
355-
static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data,
355+
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
356356
char *headers, char *headers_lc, char **error_message)
357357
{
358358
int res;
@@ -633,7 +633,7 @@ static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char
633633
return (SUCCESS);
634634
}
635635

636-
static int addToHeader(char **header_buffer, const char *specifier, char *string)
636+
static int addToHeader(char **header_buffer, const char *specifier, const char *string)
637637
{
638638
*header_buffer = erealloc(*header_buffer, strlen(*header_buffer) + strlen(specifier) + strlen(string) + 1);
639639
sprintf(*header_buffer + strlen(*header_buffer), specifier, string);
@@ -651,7 +651,7 @@ static int addToHeader(char **header_buffer, const char *specifier, char *string
651651
// Author/Date: jcar 20/9/96
652652
// History:
653653
//********************************************************************/
654-
static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders)
654+
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders)
655655
{
656656
/* Print message header according to RFC 822 */
657657
/* Return-path, Received, Date, From, Subject, Sender, To, cc */

win32/sendmail.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333

3434

3535
PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message,
36-
char *RPath, char *Subject, char *mailTo, char *data,
36+
char *RPath, const char *Subject, const char *mailTo, const char *data,
3737
char *mailCc, char *mailBcc, char *mailRPath);
3838
PHPAPI void TSMClose(void);
39-
static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data,
39+
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
4040
char *headers, char *headers_lc, char **error_message);
4141
PHPAPI char *GetSMErrorText(int index);
4242

4343
static int MailConnect();
44-
static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders);
44+
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders);
4545
static int Post(LPCSTR msg);
4646
static int Ack(char **server_response);
4747
static unsigned long GetAddr(LPSTR szHost);

0 commit comments

Comments
 (0)