summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-16 18:24:03 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-16 18:24:03 +0000
commit919fba4e60e63736a65a31db07550b9f33973088 (patch)
treebb5321619f9610d0615d6b550d14397eab882066
parentce1639425f86841046e6929a6560309e134189b2 (diff)
downloadhercules-919fba4e60e63736a65a31db07550b9f33973088.tar.gz
hercules-919fba4e60e63736a65a31db07550b9f33973088.tar.bz2
hercules-919fba4e60e63736a65a31db07550b9f33973088.tar.xz
hercules-919fba4e60e63736a65a31db07550b9f33973088.zip
added null pointer check from freya
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@588 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/common/db.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/db.c b/src/common/db.c
index 58f0ea4f7..304165fc2 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -441,7 +441,11 @@ void db_foreach(struct dbt *table,int (*func)(void*,void*,va_list),...)
continue;
sp=0;
while(1){
- func(p->key,p->data,ap);
+ if (!p->data) {
+ printf("Warning: no data for key %d in db_foreach (db.c) !\n",p->key);
+ } else {
+ func(p->key, p->data, ap);
+ }
if((pn=p->left)!=NULL){
if(p->right){
stack[sp++]=p->right;