mirror of
https://github.com/rafagafe/tiny-json.git
synced 2025-03-12 19:25:30 +00:00
Fix empty string as input.
This commit is contained in:
parent
7afe260b8d
commit
6935d1fdc3
@ -47,7 +47,7 @@ static char* _setToNull( char* ch );
|
||||
/* Parse a string to get a json. */
|
||||
json_t const* json_create( char* str, json_t mem[], unsigned int qty ) {
|
||||
char* ptr = _goWhiteSpace( str );
|
||||
if ( *ptr != '{') return 0;
|
||||
if ( !ptr || *ptr != '{' ) return 0;
|
||||
jsonPool_t pool = { .mem = mem, .qty = qty };
|
||||
json_t* obj = _poolInit( &pool );
|
||||
obj->name = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user