Use 'snprintf()' instead of the unsafe variant

This commit is contained in:
Jonas Kulla 2013-09-27 19:50:23 +02:00
parent 080f9333a9
commit 0717003114
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ MRB_METHOD_PUB(inspectObject)
mrb_value priv = mrb_obj_iv_get(mrb, mrb_obj_ptr(self), getSym(mrb, CSpriv_iv));
static char buffer[64];
sprintf(buffer, "#<%s:%p>", DATA_TYPE(priv)->struct_name, DATA_PTR(priv));
snprintf(buffer, sizeof(buffer), "#<%s:%p>", DATA_TYPE(priv)->struct_name, DATA_PTR(priv));
return mrb_str_new_cstr(mrb, buffer);
}