From e67044de82000e88ed71bba7e949cf9c89015284 Mon Sep 17 00:00:00 2001 From: fito Date: Mon, 5 Apr 2021 05:37:06 -0500 Subject: [PATCH] :eyes: Checking the double call to the system function in method MInstall::makeLinuxPartition --- minstall.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/minstall.cpp b/minstall.cpp index 03e92d2..91733c1 100644 --- a/minstall.cpp +++ b/minstall.cpp @@ -131,9 +131,8 @@ QString MInstall::getCmdOut(QString cmd) if (fp == NULL) { return QString (ret); } - int i; if (fgets(line, sizeof line, fp) != NULL) { - i = strlen(line); + int i = strlen(line); line[--i] = '\0'; ret = line; } @@ -506,9 +505,10 @@ bool MInstall::makeLinuxPartition(QString dev, const char *type, bool bad, QStri if (strncmp(type, "ext*", 4) == 0) { // ext4 tuning cmd = QString("/sbin/tune2fs -c0 -C0 -i1m %1").arg(dev); - } - if (system(cmd.toUtf8()) != 0) { - // error + if (system(cmd.toUtf8()) != 0) { + // error + return false; + } } } return true;