mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-25 00:31:08 +00:00
Update sdb from git
This commit is contained in:
parent
a738fd259c
commit
03107dafed
@ -1,4 +1,4 @@
|
||||
/* sdb - LGPLv3 - Copyright 2011-2014 - pancake */
|
||||
/* sdb - LGPLv3 - Copyright 2011-2015 - pancake */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -161,13 +161,16 @@ SDB_API char *sdb_querys (Sdb *r, char *buf, size_t len, const char *_cmd) {
|
||||
} else {
|
||||
if (len<1 || !buf) {
|
||||
bufset = 1;
|
||||
buf = malloc ((len=64));
|
||||
buf = malloc ((len = 64));
|
||||
}
|
||||
cmd = buf;
|
||||
}
|
||||
// if cmd is null, we take buf as cmd
|
||||
next = NULL;
|
||||
repeat:
|
||||
/* skip spaces */
|
||||
while (*cmd && (*cmd == ' ' || *cmd == '\t'))
|
||||
cmd++;
|
||||
s = r;
|
||||
p = cmd;
|
||||
eq = NULL;
|
||||
@ -176,7 +179,7 @@ repeat:
|
||||
quot = NULL;
|
||||
json = NULL;
|
||||
if (next) *next = ';';
|
||||
if (*p=='%') {
|
||||
if (*p == '%') {
|
||||
encode = 1;
|
||||
cmd++;
|
||||
p++;
|
||||
@ -197,7 +200,7 @@ repeat:
|
||||
d = 0;
|
||||
}
|
||||
if (!is_ref) {
|
||||
next = strchr (val?val:cmd, ';'); //val?val:cmd, ';');
|
||||
next = strchr (val? val: cmd, ';');
|
||||
}
|
||||
//if (!val) val = eq;
|
||||
if (!is_ref && val && *val == '"') {
|
||||
|
@ -74,9 +74,7 @@ SDB_API ut64 sdb_atoi(const char *s) {
|
||||
ut64 ret;
|
||||
if (!s || *s=='-')
|
||||
return 0LL;
|
||||
ret = !strncmp (s, "0x", 2)?
|
||||
strtoull (s+2, &p, 16):
|
||||
strtoull (s, &p, 10);
|
||||
ret = strtoull (s, &p, 0);
|
||||
if (!p) return 0LL;
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user