From a82220211ddb700cf9e3dc82c6e736eefe83e4b8 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sun, 6 Feb 2022 16:12:41 +0900 Subject: [PATCH] Support `MRB_NO_STDIO` for `mrbgems/mruby-errno` --- mrbgems/mruby-errno/src/errno.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mrbgems/mruby-errno/src/errno.c b/mrbgems/mruby-errno/src/errno.c index 74df5d0fc..0fb952b2b 100644 --- a/mrbgems/mruby-errno/src/errno.c +++ b/mrbgems/mruby-errno/src/errno.c @@ -6,7 +6,6 @@ #include "mruby/string.h" #include "mruby/variable.h" #include -#include #include #include @@ -40,8 +39,8 @@ mrb_sce_init(mrb_state *mrb, mrb_value self, mrb_value m, mrb_int n) if (e2c[i].sym == 0) { mrb_iv_set(mrb, self, MRB_SYM(errno), mrb_fixnum_value(n)); str = mrb_str_new_cstr(mrb, "Unknown error: "); - snprintf(buf, sizeof(buf), "%d", (int)n); - mrb_str_cat2(mrb, str, buf); + char *bp = mrb_int_to_cstr(buf, sizeof(buf), n, 10); + mrb_str_cat2(mrb, str, bp); } } else {