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:
parent
75d4b76993
commit
8a541cdba3
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user