Fixed va_list being reused in DBMap code (linkdb_foreach()) (bugreport:5367).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15628 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
gepard1984 2012-02-24 16:50:34 +00:00
parent 75d4b76993
commit 8a541cdba3

View File

@ -2601,15 +2601,14 @@ void linkdb_insert( struct linkdb_node** head, void *key, void* data)
void linkdb_foreach( struct linkdb_node** head, LinkDBFunc func, ... ) void linkdb_foreach( struct linkdb_node** head, LinkDBFunc func, ... )
{ {
va_list args;
struct linkdb_node *node; struct linkdb_node *node;
if( head == NULL ) return; if( head == NULL ) return;
va_start(args, func);
node = *head; node = *head;
while ( node ) { while ( node ) {
va_list args;
va_start(args, func);
func( node->key, node->data, args ); func( node->key, node->data, args );
va_end(args);
node = node->next; node = node->next;
} }
} }