rxi/ini

ini_sget doesn't work correctly in forking programs

SuperPrower opened this issue · 2 comments

It's not really a problem or bug rather then a little inconvenience and warning to others.

I am working on screen locker, and I tried to tie it in with .ini parser - and this one was best of them all.

However, because this screen locker forks at some point, .ini get freed and char array contents get corrupted.

Again, I understand why such method was selected, but anyway, using *((const char**) dst) = val; is somewhat unreliable in such programs. I am now using strcpy to get content of string after getting value with ini_sget or ini_get.

Because it's not a bug or anything that need to be changed, I am going to close it

i think ini_sget offered a convenience way when we need to get specify type of value.
if we do not give the format argument scanfmt, we can use the pointer of value directly without transmit varient allocated outside. so this is what *((const char**) dst) = val do.
anyway, tiny but usefull , simple and clever way to parse.