$NetBSD: patch-ad,v 1.2 2009/04/24 10:17:22 adam Exp $

  - test for success of _GeoIP_seek_record(). 0 is a valid return value.
    http://sourceforge.net/tracker/index.php?func=detail&aid=1888390&group_id=66844&atid=515957

--- libGeoIP/GeoIP.c.orig	2009-02-24 17:03:23.000000000 +0100
+++ libGeoIP/GeoIP.c
@@ -934,8 +934,8 @@ int GeoIP_id_by_name (GeoIP* gi, const c
 	}
 	if (!(ipnum = _GeoIP_lookupaddress(name)))
 		return 0;
-	ret = _GeoIP_seek_record(gi, ipnum) - COUNTRY_BEGIN;
-	return ret;
+	ret = _GeoIP_seek_record(gi, ipnum);
+	return (ret != 0) ? ret - COUNTRY_BEGIN : 0 ;
 
 }
 
