diff options
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -477,10 +477,7 @@ dir_inspect(VALUE dir) Data_Get_Struct(dir, struct dir_data, dirp); if (dirp->path) { const char *c = rb_obj_classname(dir); - int len = strlen(c) + strlen(dirp->path) + 4; - VALUE s = rb_str_new(0, len); - snprintf(RSTRING_PTR(s), len+1, "#<%s:%s>", c, dirp->path); - return s; + return rb_sprintf("#<%s:%s>", c, dirp->path); } return rb_funcall(dir, rb_intern("to_s"), 0, 0); } |