src/json.c

changeset 1057
4e8436c3e806
parent 1055
221e2e2f2c06
child 1060
0a7c1bb2372d
equal deleted inserted replaced
1056:e180bd389fbc 1057:4e8436c3e806
712 if (v == NULL) return NULL; 712 if (v == NULL) return NULL;
713 v->allocator = allocator; 713 v->allocator = allocator;
714 v->type = CX_JSON_STRING; 714 v->type = CX_JSON_STRING;
715 cxmutstr s = cx_strdup_a(allocator, str); 715 cxmutstr s = cx_strdup_a(allocator, str);
716 if (s.ptr == NULL) { cxFree(allocator, v); return NULL; } 716 if (s.ptr == NULL) { cxFree(allocator, v); return NULL; }
717 v->value.string = s;
717 return v; 718 return v;
718 } 719 }
719 720
720 CxJsonValue* cxJsonCreateLiteral(const CxAllocator* allocator, CxJsonLiteral lit) { 721 CxJsonValue* cxJsonCreateLiteral(const CxAllocator* allocator, CxJsonLiteral lit) {
721 CxJsonValue* v = cxMalloc(allocator, sizeof(CxJsonValue)); 722 CxJsonValue* v = cxMalloc(allocator, sizeof(CxJsonValue));

mercurial