Remove non formatting fprintf().
MODIFY
mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c
mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c
@@ -346,7 +346,7 @@ main(int argc, char **argv)
}
}
else {
- fprintf(stderr, "Output file is required\n");
+ fputs("Output file is required\n", stderr);
return EXIT_FAILURE;
}
result = dump_file(mrb, wfp, args.outfile, mrb_proc_ptr(load), &args);

MODIFY
mrbgems/mruby-test/driver.c
mrbgems/mruby-test/driver.c
@@ -290,7 +290,7 @@ main(int argc, char **argv)
/* new interpreter instance */
mrb = mrb_open();
if (mrb == NULL) {
- fprintf(stderr, "Invalid mrb_state, exiting test driver");
+ fputs("Invalid mrb_state, exiting test driver", stderr);
return EXIT_FAILURE;
}

MODIFY
src/backtrace.c
src/backtrace.c
@@ -105,20 +105,22 @@ print_backtrace(mrb_state *mrb, struct RObject *exc, struct RArray *backtrace)
if (n != 0) {
if (n > 1) {
- fprintf(stderr, "trace (most recent call last):\n");
+ fputs("trace (most recent call last):\n", stderr);
}
for (i=n-1,loc=&ARY_PTR(backtrace)[i]; i>0; i--,loc--) {
if (mrb_string_p(*loc)) {
- fprintf(stderr, "\t[%d] %.*s\n",
- (int)i, (int)RSTRING_LEN(*loc), RSTRING_PTR(*loc));
+ fprintf(stderr, "\t[%d] ", (int)i);
+ fwrite(RSTRING_PTR(*loc), (int)RSTRING_LEN(*loc), 1, stderr);
+ fputc('\n', stderr);
}
}
if (mrb_string_p(*loc)) {
- fprintf(stderr, "%.*s: ", (int)RSTRING_LEN(*loc), RSTRING_PTR(*loc));
+ fwrite(RSTRING_PTR(*loc), (int)RSTRING_LEN(*loc), 1, stderr);
+ fputs(": ", stderr);
}
}
else {
- fprintf(stderr, "%s:0: ", "(unknown)");
+ fputs("(unknown):0: ", stderr);
}
if (exc == mrb->nomem_err) {

Remove non formatting fprintf().