Skip to content

Commit cb3a8be

Browse files
committed
Address review comments
1 parent ccecfe0 commit cb3a8be

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ext/standard/mail.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
438438
{
439439
FILE *sendmail;
440440
const char *sendmail_path = zend_ini_string_literal("sendmail_path");
441-
char *sendmail_cmd = NULL;
441+
const char *sendmail_cmd = NULL;
442442
const zend_string *mail_log = zend_ini_str_literal("mail.log");
443443
const char *hdr = headers;
444444
char *ahdr = NULL;
@@ -553,7 +553,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
553553
if (extra_cmd != NULL) {
554554
spprintf(&sendmail_cmd, 0, "%s %s", sendmail_path, ZSTR_VAL(extra_cmd));
555555
} else {
556-
sendmail_cmd = (char*)sendmail_path;
556+
sendmail_cmd = sendmail_path;
557557
}
558558

559559
#if PHP_SIGCHILD
@@ -576,7 +576,7 @@ PHPAPI bool php_mail(const char *to, const char *subject, const char *message, c
576576
sendmail = popen(sendmail_cmd, "w");
577577
#endif
578578
if (extra_cmd != NULL) {
579-
efree (sendmail_cmd);
579+
efree((char*)sendmail_cmd);
580580
}
581581

582582
if (sendmail) {

ext/zlib/zlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
12801280
}
12811281
const zend_string *ini_value = zend_ini_str_literal("output_handler");
12821282

1283-
if (ini_value && ZSTR_LEN(ini_value) && int_value) {
1283+
if (ini_value && ZSTR_LEN(ini_value) > 0 && int_value) {
12841284
php_error_docref("ref.outcontrol", E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
12851285
return FAILURE;
12861286
}

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,9 +1194,9 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, const char *
11941194

11951195
if (strchr(*path, '/') != NULL || strchr(*path, DEFAULT_SLASH) != NULL) {
11961196
/* path is fine */
1197-
} else if (extension_dir && ZSTR_LEN(extension_dir)) {
1197+
} else if (extension_dir && ZSTR_LEN(extension_dir) > 0) {
11981198
char *libpath;
1199-
if (IS_SLASH(ZSTR_VAL(extension_dir)[ZSTR_LEN(extension_dir-1)])) {
1199+
if (IS_SLASH(ZSTR_VAL(extension_dir)[ZSTR_LEN(extension_dir)-1])) {
12001200
spprintf(&libpath, 0, "%s%s", ZSTR_VAL(extension_dir), *path); /* SAFE */
12011201
} else {
12021202
spprintf(&libpath, 0, "%s%c%s", ZSTR_VAL(extension_dir), DEFAULT_SLASH, *path); /* SAFE */

0 commit comments

Comments
 (0)