project_files/hwc/rtl/fileio.c
changeset 10575 13b1e9008f4b
parent 9966 01e198990211
child 11682 2c21bc80c95d
--- a/project_files/hwc/rtl/fileio.c	Sat Nov 29 17:33:51 2014 +0100
+++ b/project_files/hwc/rtl/fileio.c	Sat Nov 29 18:13:49 2014 +0100
@@ -162,7 +162,11 @@
 
 void __attribute__((overloadable)) fpcrtl_writeLn(File f, string255 s) {
     FIX_STRING(s);
-    fprintf(f->fp, "%s\n", s.str);
+    // filthy hack to write to stderr
+    if (!f->fp)
+        fprintf(stderr, "%s\n", s.str);
+    else
+        fprintf(f->fp, "%s\n", s.str);
 }
 
 void __attribute__((overloadable)) fpcrtl_writeLn(FILE *f, string255 s) {