Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 17ec104

Browse files
committed
Minor code cleanup
1 parent 35f2eda commit 17ec104

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/geoip.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1844,11 +1844,12 @@ function _get_region($gi, $ipnum)
18441844
$country_code = "CA";
18451845
$region = chr(($seek_region - CANADA_OFFSET) / 26 + 65) . chr(($seek_region - CANADA_OFFSET) % 26 + 65);
18461846
} else {
1847-
$country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE];
1847+
$country_code = $gi->GEOIP_COUNTRY_CODES[(int) (($seek_region - WORLD_OFFSET) / FIPS_RANGE)];
18481848
$region = "";
18491849
}
18501850
return array($country_code, $region);
18511851
}
1852+
return null;
18521853
}
18531854

18541855
function geoip_region_by_addr($gi, $addr)

src/geoipcity.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function _common_get_record($gi, $seek_country)
112112
$record->postal_code = substr($record_buf, $record_buf_pos, $str_length);
113113
}
114114
$record_buf_pos += $str_length + 1;
115-
$str_length = 0;
115+
116116
// Get latitude and longitude
117117
$latitude = 0;
118118
$longitude = 0;

timezone/make_time_zone_php_code.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Get time zone
2222
* @param string $country
2323
* @param string $region
24-
* @return string If the timezone is not found, returns NULL
24+
* @return string If the timezone is not found, returns null`
2525
*/
2626
function get_time_zone($country, $region)
2727
{

0 commit comments

Comments
 (0)