summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-print
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-01-24 22:20:56 +0900
committerGitHub <[email protected]>2019-01-24 22:20:56 +0900
commit8eddcbf53dae205f279668cdd4d47180e7a26c73 (patch)
treec8dbfe2644bb81891b4a4fe5e4fe506c8a7402e4 /mrbgems/mruby-print
parent5956f5b4e8a986a8aedb71a2692be87645abee02 (diff)
parenta4c5fcc0388c80f72f004ff719c7580a98e1e516 (diff)
downloadmruby-8eddcbf53dae205f279668cdd4d47180e7a26c73.tar.gz
mruby-8eddcbf53dae205f279668cdd4d47180e7a26c73.zip
Merge pull request #4244 from shuujii/remove-redundant-null-check-for-mrb_malloc
Remove redundant `NULL` check for `mrb_malloc`
Diffstat (limited to 'mrbgems/mruby-print')
-rw-r--r--mrbgems/mruby-print/src/print.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/mrbgems/mruby-print/src/print.c b/mrbgems/mruby-print/src/print.c
index e181b06e0..f7f99fc77 100644
--- a/mrbgems/mruby-print/src/print.c
+++ b/mrbgems/mruby-print/src/print.c
@@ -23,7 +23,6 @@ printstr(mrb_state *mrb, mrb_value obj)
char* utf8 = RSTRING_PTR(obj);
int wlen = MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, NULL, 0);
wchar_t* utf16 = (wchar_t*)mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t));
- if (utf16 == NULL) return;
if (MultiByteToWideChar(CP_UTF8, 0, utf8, mlen, utf16, wlen) > 0) {
utf16[wlen] = 0;
WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),