Use NULL instead of 0; close #2467

The PR was from @cubicdaiya.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-09-07 16:39:03 +09:00
parent 3ff2757bf7
commit 12881ccb05
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ mrb_true(mrb_state *mrb, mrb_value obj)
static mrb_value
nil_to_s(mrb_state *mrb, mrb_value obj)
{
mrb_value str = mrb_str_new_frozen(mrb, 0, 0);
mrb_value str = mrb_str_new_frozen(mrb, NULL, 0);
RSTR_SET_ASCII_FLAG(mrb_str_ptr(str));
return str;
}
+1 -1
View File
@@ -571,7 +571,7 @@ sym_inspect(mrb_state *mrb, mrb_value sym)
char *sp;
name = mrb_sym_name_len(mrb, id, &len);
str = mrb_str_new(mrb, 0, len+1);
str = mrb_str_new(mrb, NULL, len+1);
sp = RSTRING_PTR(str);
sp[0] = ':';
memcpy(sp+1, name, len);