radareorg / sdb

Simple and fast string based key-value database with support for arrays and json
https://www.radare.org/
MIT License
217 stars 62 forks source link

Correcting strcmp() in sdb_set_internal #109

Closed ghost closed 8 years ago

ghost commented 8 years ago

After my misunderstanding in radare/radare2#5739, I've checked out sdb and noticed that test/cas.c appears to fail on a fresh checkout. I am assuming the tests are correct and that the functionality of setting the same key twice should not fail.

Before:

time ./cas
r2 = c2
error
r0 = c2
failed
        0.00 real         0.00 user         0.00 sys

After this change is applied:

cc -o cas cas.c ../src/libsdb.a -I../../src -I ../src
time ./cas
r2 = c2
r3 = c3
        0.00 real         0.00 user         0.00 sys
radare commented 8 years ago

yeah the test looks good now. but not the behaviour. thanks for reporting, i would like to merge when this test passes.

ghost commented 8 years ago

Thank you, I intend on working towards fixing this later this evening. Your feedback would be appreciated.

trufae commented 8 years ago

Fixed in be217e3f68c8798cb75a3b5315620497ec887a8b. Thanks for pointing out!