From f2f28c856c496f109e9bed92da6fea6d7556304b Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 2 Oct 2017 16:09:55 +0200 Subject: [PATCH] Prevent crashes on viewing certain text files (sourcecode, mainly) --- source/utils/scripting.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utils/scripting.c b/source/utils/scripting.c index fbcf129..c4f5b2d 100644 --- a/source/utils/scripting.c +++ b/source/utils/scripting.c @@ -861,7 +861,7 @@ void MemTextView(const char* text, u32 len, char* line0, int off_disp, int lno, if (ar) memcpy(txtstr + p_ar, ar_str, strnlen(ar_str, 16)); // draw line number & text - DrawStringF(TOP_SCREEN, x_txt, y, color_text, COLOR_STD_BG, txtstr); + DrawString(TOP_SCREEN, txtstr, x_txt, y, color_text, COLOR_STD_BG); if (TV_LNOS > 0) { // line number if (ptr != ptr_next) DrawStringF(TOP_SCREEN, x_lno, y, ((ptr == text) || (*(ptr-1) == '\n')) ? COLOR_TVOFFS : COLOR_TVOFFSL, COLOR_STD_BG, "%0*lu", TV_LNOS, nln); @@ -871,7 +871,7 @@ void MemTextView(const char* text, u32 len, char* line0, int off_disp, int lno, // colorize comment if is_script if ((cmt_start > 0) && (cmt_start < TV_LLEN_DISP)) { memset(txtstr, ' ', cmt_start); - DrawStringF(TOP_SCREEN, x_txt, y, script_color_comment, COLOR_TRANSPARENT, txtstr); + DrawString(TOP_SCREEN, txtstr, x_txt, y, script_color_comment, COLOR_TRANSPARENT); } // colorize arrows