Minor conditions simplify (#10397)

This commit is contained in:
Michael Voříšek 2023-04-26 15:12:01 +02:00 committed by GitHub
parent 8086baa981
commit f89fe830f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -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;
}

View file

@ -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);
}

View file

@ -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--;

View file

@ -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;
}