summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorYukihiro Matz Matsumoto <[email protected]>2013-03-26 17:11:55 +0900
committerYukihiro Matz Matsumoto <[email protected]>2013-03-26 17:11:55 +0900
commit471ad60688be5ea8834fe4aaa404ef67cc8a9977 (patch)
treee9f06f90e1e9b8035efd8a5872ab575072f98532 /src/state.c
parent87d7fc616504dff16a22e24bc5fa67aae2be0d30 (diff)
downloadmruby-471ad60688be5ea8834fe4aaa404ef67cc8a9977.tar.gz
mruby-471ad60688be5ea8834fe4aaa404ef67cc8a9977.zip
use C99 flexible array member instead of [1]
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c
index 92cce33a1..cf0f9dee0 100644
--- a/src/state.c
+++ b/src/state.c
@@ -45,7 +45,7 @@ allocf(mrb_state *mrb, void *p, size_t size, void *ud)
struct alloca_header {
struct alloca_header *next;
- char buf[1];
+ char buf[];
};
void*
@@ -53,7 +53,7 @@ mrb_alloca(mrb_state *mrb, size_t size)
{
struct alloca_header *p;
- p = (struct alloca_header*) mrb_malloc(mrb, sizeof(struct alloca_header)+size-1);
+ p = (struct alloca_header*) mrb_malloc(mrb, sizeof(struct alloca_header)+size);
if (p == NULL) return NULL;
p->next = mrb->mems;
mrb->mems = p;