mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-20 13:46:06 +00:00
Fix stderr/stdin confusion and avoid crash on fdopen
This commit is contained in:
parent
896be642ff
commit
c07ce55581
@ -424,7 +424,9 @@ void ConsoleWidget::processQueuedOutput()
|
||||
while (pipeSocket->canReadLine()) {
|
||||
QString output = QString(pipeSocket->readLine());
|
||||
|
||||
fprintf(origStderr, "%s", output.toStdString().c_str());
|
||||
if (origStderr) {
|
||||
fprintf(origStderr, "%s", output.toStdString().c_str());
|
||||
}
|
||||
|
||||
// Get the last segment that wasn't overwritten by carriage return
|
||||
output = output.trimmed();
|
||||
@ -449,7 +451,7 @@ void ConsoleWidget::redirectOutput()
|
||||
|
||||
pipeSocket = new QLocalSocket(this);
|
||||
|
||||
origStdin = fdopen(dup(fileno(stderr)), "r");
|
||||
origStdin = fdopen(dup(fileno(stdin)), "r");
|
||||
origStderr = fdopen(dup(fileno(stderr)), "a");
|
||||
origStdout = fdopen(dup(fileno(stdout)), "a");
|
||||
#ifdef Q_OS_WIN
|
||||
|
Loading…
Reference in New Issue
Block a user