diff options
| author | Masaki Muranaka <[email protected]> | 2012-06-27 10:36:39 +0900 |
|---|---|---|
| committer | Masaki Muranaka <[email protected]> | 2012-06-27 10:36:39 +0900 |
| commit | d534f26f16ba94c2182a44e4201352d1fb277af0 (patch) | |
| tree | a89747c77b2ed49c7b155969a5a0a91f69465bcc /src/codegen.c | |
| parent | cf8b6ec8418ce3970a82b80d514a17b0ffa61b53 (diff) | |
| download | mruby-d534f26f16ba94c2182a44e4201352d1fb277af0.tar.gz mruby-d534f26f16ba94c2182a44e4201352d1fb277af0.zip | |
Use sizeof to get char array sizes.
Diffstat (limited to 'src/codegen.c')
| -rw-r--r-- | src/codegen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.c b/src/codegen.c index cbf401a1f..fb0006625 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -1537,7 +1537,7 @@ codegen(codegen_scope *s, node *tree, int val) int len; int sym; - len = snprintf(buf, 3, "$%c", (int)(intptr_t)tree); + len = snprintf(buf, sizeof(buf), "$%c", (int)(intptr_t)tree); sym = new_sym(s, mrb_intern2(s->mrb, buf, len)); genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym)); push(); @@ -1550,7 +1550,7 @@ codegen(codegen_scope *s, node *tree, int val) int len; int sym; - len = snprintf(buf, 3, "$%d", (int)(intptr_t)tree); + len = snprintf(buf, sizeof(buf), "$%d", (int)(intptr_t)tree); sym = new_sym(s, mrb_intern2(s->mrb, buf, len)); genop(s, MKOP_ABx(OP_GETGLOBAL, cursp(), sym)); push(); |
