summaryrefslogtreecommitdiff
path: root/val.c
diff options
context:
space:
mode:
Diffstat (limited to 'val.c')
-rw-r--r--val.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/val.c b/val.c
index c1b83c3..355aac6 100644
--- a/val.c
+++ b/val.c
@@ -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;