提交 6aae78a7 编写于 作者: N ndevilla

Merge branch 'fixes' of https://github.com/mbrossard/iniparser into mbrossard-fixes

...@@ -266,12 +266,11 @@ int dictionary_set(dictionary * d, char * key, char * val) ...@@ -266,12 +266,11 @@ int dictionary_set(dictionary * d, char * key, char * val)
d->size *= 2 ; d->size *= 2 ;
} }
/* Insert key in the first empty slot */ /* Insert key in the first empty slot. Start at d->n and wrap at
for (i=0 ; i<d->size ; i++) { d->size. Because d->n < d->size this will necessarily
if (d->key[i]==NULL) { terminate. */
/* Add key here */ for (i=d->n ; d->key[i] ; ) {
break ; if(++i == d->size) i = 0;
}
} }
/* Copy key */ /* Copy key */
d->key[i] = xstrdup(key); d->key[i] = xstrdup(key);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册