summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-24 16:50:34 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-24 16:50:34 +0000
commit98b876139a91fd1b44719c3f1d21c754096a1377 (patch)
tree455455b7f185ccd6c73ea4552a7c225fc187afd9 /src
parent9b452a0918913ab0956ac17fee6b1c49815af3f7 (diff)
downloadhercules-98b876139a91fd1b44719c3f1d21c754096a1377.tar.gz
hercules-98b876139a91fd1b44719c3f1d21c754096a1377.tar.bz2
hercules-98b876139a91fd1b44719c3f1d21c754096a1377.tar.xz
hercules-98b876139a91fd1b44719c3f1d21c754096a1377.zip
Fixed `va_list` being reused in DBMap code (`linkdb_foreach()`) (bugreport:5367).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15628 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/common/db.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/db.c b/src/common/db.c
index 74c3b1f91..481e9db2a 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -2601,15 +2601,14 @@ void linkdb_insert( struct linkdb_node** head, void *key, void* data)
void linkdb_foreach( struct linkdb_node** head, LinkDBFunc func, ... )
{
- va_list args;
struct linkdb_node *node;
-
if( head == NULL ) return;
-
- va_start(args, func);
node = *head;
while ( node ) {
+ va_list args;
+ va_start(args, func);
func( node->key, node->data, args );
+ va_end(args);
node = node->next;
}
}