mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-12 17:48:33 +00:00
Update sdb fixing some coverity warns
This commit is contained in:
parent
10dc0c6ef4
commit
cac402ef63
@ -81,10 +81,11 @@ typedef struct {
|
||||
|
||||
static int foreach_list_cb(void *user, const char *k, const char *v) {
|
||||
ForeachListUser *rlu = user;
|
||||
char *line, *root = rlu->root;
|
||||
char *line, *root;
|
||||
int rlen, klen, vlen;
|
||||
ut8 *v2 = NULL;
|
||||
if (!rlu) return 0;
|
||||
root = rlu->root;
|
||||
klen = strlen (k);
|
||||
if (rlu->encode) {
|
||||
v2 = sdb_decode (v, NULL);
|
||||
|
@ -220,9 +220,8 @@ SDB_API const char *sdb_type(const char *k) {
|
||||
SDB_API int sdb_isjson (const char *k) {
|
||||
int level = 0;
|
||||
int quotes = 0;
|
||||
if (*k!='{' && *k != '[')
|
||||
if (!k || (*k!='{' && *k != '['))
|
||||
return 0;
|
||||
if (k)
|
||||
for (; *k; k++) {
|
||||
if (quotes) {
|
||||
if (*k == '"')
|
||||
@ -231,8 +230,7 @@ SDB_API int sdb_isjson (const char *k) {
|
||||
}
|
||||
switch (*k) {
|
||||
case '"':
|
||||
if (quotes) quotes = 0;
|
||||
else quotes = 1;
|
||||
quotes = 1;
|
||||
break;
|
||||
case '[':
|
||||
case '{':
|
||||
|
Loading…
x
Reference in New Issue
Block a user