diff options
Diffstat (limited to 'val.c')
-rw-r--r-- | val.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -5,11 +5,10 @@ ObjString *objstring_new(char *src, size_t len) { - char *d = M(NULL, (1 + len) * sizeof (char)); + char *d = NEW_ARR(char, 1+len); memcpy(d, src, len); d[len] = '\0'; - ObjString *o = M(NULL, sizeof(ObjString)); - o->obj.oty = OTY_STRING; + ObjString *o = NEW_OBJ(ObjString, OTY_STRING); o->len = len; o->b = d; return o; |