Skip to content

Commit 312c919

Browse files
committed
ext/standard/mail.c: change return type of php_mail() to bool
1 parent 962aba3 commit 312c919

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

ext/standard/mail.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static int php_mail_detect_multiple_crlf(const char *hdr) {
408408

409409

410410
/* {{{ php_mail */
411-
PHPAPI int php_mail(const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd)
411+
PHPAPI bool php_mail(const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd)
412412
{
413413
FILE *sendmail;
414414
char *sendmail_path = INI_STR("sendmail_path");
@@ -459,7 +459,7 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
459459
}
460460

461461
if (EG(exception)) {
462-
MAIL_RET(0);
462+
MAIL_RET(false);
463463
}
464464

465465
char *line_sep = PG(mail_mixed_lf_and_crlf) ? "\n" : "\r\n";
@@ -481,7 +481,7 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
481481

482482
if (hdr && php_mail_detect_multiple_crlf(hdr)) {
483483
php_error_docref(NULL, E_WARNING, "Multiple or malformed newlines found in additional_header");
484-
MAIL_RET(0);
484+
MAIL_RET(false);
485485
}
486486

487487
if (!sendmail_path) {
@@ -497,11 +497,11 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
497497
} else {
498498
php_error_docref(NULL, E_WARNING, "%s", GetSMErrorText(tsm_err));
499499
}
500-
MAIL_RET(0);
500+
MAIL_RET(false);
501501
}
502-
MAIL_RET(1);
502+
MAIL_RET(true);
503503
#else
504-
MAIL_RET(0);
504+
MAIL_RET(false);
505505
#endif
506506
}
507507
if (extra_cmd != NULL) {
@@ -545,7 +545,7 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
545545
signal(SIGCHLD, sig_handler);
546546
}
547547
#endif
548-
MAIL_RET(0);
548+
MAIL_RET(false);
549549
}
550550
#endif
551551
fprintf(sendmail, "To: %s%s", to, line_sep);
@@ -574,9 +574,9 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
574574
#endif
575575
#endif
576576
{
577-
MAIL_RET(0);
577+
MAIL_RET(false);
578578
} else {
579-
MAIL_RET(1);
579+
MAIL_RET(true);
580580
}
581581
} else {
582582
php_error_docref(NULL, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path);
@@ -585,10 +585,10 @@ PHPAPI int php_mail(const char *to, const char *subject, const char *message, co
585585
signal(SIGCHLD, sig_handler);
586586
}
587587
#endif
588-
MAIL_RET(0);
588+
MAIL_RET(false);
589589
}
590590

591-
MAIL_RET(1); /* never reached */
591+
MAIL_RET(true); /* never reached */
592592
}
593593
/* }}} */
594594

ext/standard/php_mail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
PHP_MINFO_FUNCTION(mail);
2121

2222
PHPAPI zend_string *php_mail_build_headers(HashTable *headers);
23-
PHPAPI extern int php_mail(const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd);
23+
PHPAPI extern bool php_mail(const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd);
2424

2525
#define PHP_MAIL_BUILD_HEADER_CHECK(target, s, key, val) \
2626
do { \

0 commit comments

Comments
 (0)