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