• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

mrubyを超漢字で動作させる


Commit MetaInfo

Revisionaff65afe97cc241af396ceb8df15bed27788c108 (tree)
Zeit2014-07-12 20:36:45
Autorcremno <cremno@mail...>
CommiterYukihiro "Matz" Matsumoto

Log Message

check the return value of fwrite

Ändern Zusammenfassung

Diff

--- a/src/dump.c
+++ b/src/dump.c
@@ -952,7 +952,9 @@ mrb_dump_irep_binary(mrb_state *mrb, mrb_irep *irep, int debug_info, FILE* fp)
952952
953953 result = mrb_dump_irep(mrb, irep, debug_info, &bin, &bin_size);
954954 if (result == MRB_DUMP_OK) {
955- fwrite(bin, bin_size, 1, fp);
955+ if (fwrite(bin, sizeof(bin[0]), bin_size, fp) != bin_size) {
956+ result = MRB_DUMP_WRITE_FAULT;
957+ }
956958 }
957959
958960 mrb_free(mrb, bin);