added null pointer check from freya
git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@588 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
584745ca2f
commit
fffdff7512
@ -441,7 +441,11 @@ void db_foreach(struct dbt *table,int (*func)(void*,void*,va_list),...)
|
|||||||
continue;
|
continue;
|
||||||
sp=0;
|
sp=0;
|
||||||
while(1){
|
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((pn=p->left)!=NULL){
|
||||||
if(p->right){
|
if(p->right){
|
||||||
stack[sp++]=p->right;
|
stack[sp++]=p->right;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user