diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-08-30 07:35:58 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-09-01 07:00:54 +0900 |
| commit | e86c9cb57c0ee799ca66d18612e15c6c8983f872 (patch) | |
| tree | f60224602ddf0cfb7bcca1546648b5d42d6e2a95 /mrbgems/mruby-io | |
| parent | 572a43de8406da89daeaa9b433761da762d7b1c4 (diff) | |
| download | mruby-e86c9cb57c0ee799ca66d18612e15c6c8983f872.tar.gz mruby-e86c9cb57c0ee799ca66d18612e15c6c8983f872.zip | |
Do no use return values from `mrb_ensure_` functions.
They return the checking argument without modification, so the values
are already there. Maybe we should change the return type to `void` but
keep them unchanged for compatibility.
Diffstat (limited to 'mrbgems/mruby-io')
| -rw-r--r-- | mrbgems/mruby-io/src/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c index 6c62db662..a19858a63 100644 --- a/mrbgems/mruby-io/src/file.c +++ b/mrbgems/mruby-io/src/file.c @@ -116,14 +116,14 @@ static mrb_value mrb_file_s_unlink(mrb_state *mrb, mrb_value obj) { const mrb_value *argv; - mrb_value pathv; mrb_int argc, i; char *path; mrb_get_args(mrb, "*", &argv, &argc); for (i = 0; i < argc; i++) { const char *utf8_path; - pathv = mrb_ensure_string_type(mrb, argv[i]); + mrb_value pathv = argv[i]; + mrb_ensure_string_type(mrb, pathv); utf8_path = RSTRING_CSTR(mrb, pathv); path = mrb_locale_from_utf8(utf8_path, -1); if (UNLINK(path) < 0) { |
