From e738da5e89fc2d1d392775336ae4eb41e26c4f77 Mon Sep 17 00:00:00 2001 From: xiaolu Date: Sun, 22 Feb 2015 20:49:35 +0800 Subject: minuitwrp: fix crash issue, when the console use TTF font to display unicode font. gui: fix terminal command unusual line breaks and missing characters at the end of a read buf. Change-Id: I8d3d740b6066b1594c5148b2012f0e7bcbecc22b --- gui/action.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gui') diff --git a/gui/action.cpp b/gui/action.cpp index 16a550ba1..342551247 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1360,8 +1360,7 @@ int GUIAction::terminalcommand(std::string arg) } else { // Try to read output memset(line, 0, sizeof(line)); - bytes_read = read(fd, line, sizeof(line)); - if (bytes_read > 0) + if(fgets(line, sizeof(line), fp) != NULL) gui_print("%s", line); // Display output else keep_going = 0; // Done executing -- cgit v1.2.3