Skip to content

Commit 0344cc1

Browse files
committed
Fix a warning with the new example files
1 parent a96814d commit 0344cc1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/ip-to-country.inc

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ function i2c_search_in_index($ip)
9898
// Read in granularity from index file and
9999
// convert current IP to something useful
100100
$granularity = intval(fgets($dbidx, 64));
101+
if (!$granularity) {
102+
// The file is empty (demo file)
103+
return false;
104+
}
101105
$ip_chunk = intval($ip / $granularity);
102106

103107
// Loop till we can read the file

0 commit comments

Comments
 (0)