From f89fe830f2bc9337c372a5af8422b4dd241e652b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 26 Apr 2023 15:12:01 +0200 Subject: [PATCH] Minor conditions simplify (#10397) --- ext/phar/phar.c | 2 +- ext/phar/phar_object.c | 2 +- ext/phar/util.c | 2 +- sapi/fpm/status.html.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index c4eed6b60e2..d2713c2a6f6 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1965,7 +1965,7 @@ int phar_detect_phar_fname_ext(const char *filename, size_t filename_len, const *ext_str = NULL; *ext_len = 0; - if (!filename_len || filename_len == 1) { + if (filename_len <= 1) { return FAILURE; } diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index b009c0347ce..47a4ca541d1 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -496,7 +496,7 @@ carry_on: zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, arch); } - if (entry && path && path == entry) { + if (entry && path == entry) { efree(entry); } diff --git a/ext/phar/util.c b/ext/phar/util.c index 50a2e7a6627..edd10dc3837 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -1257,7 +1257,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si } if (is_dir) { - if (!path_len || path_len == 1) { + if (path_len <= 1) { return NULL; } path_len--; diff --git a/sapi/fpm/status.html.in b/sapi/fpm/status.html.in index d3b6d5efd3e..b87a446f59f 100644 --- a/sapi/fpm/status.html.in +++ b/sapi/fpm/status.html.in @@ -215,7 +215,7 @@ doc_rate.disabled = false; } else { delay = parseInt(doc_rate.value); - if (!delay || delay < 1) { + if (isNaN(delay) || delay < 1) { doc_status.innerHTML = "Not valid 'refresh' value"; return; }