mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +02:00
CShellWindow: do not dereference NULL pointers
additionally, try to shorten the debug messages slightly and make the
output more useful in the error case for my_popen()
Signed-off-by: Thilo Graf <dbt@novatux.de>
Origin commit data
------------------
Commit: f8fc83c496
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2016-01-04 (Mon, 04 Jan 2016)
This commit is contained in:
committed by
vanhofen
parent
ff1e81197a
commit
73ebe87a27
@@ -80,7 +80,7 @@ void CShellWindow::exec()
|
||||
if (!f) {
|
||||
if (res)
|
||||
*res = -1;
|
||||
dprintf(DEBUG_NORMAL, "[CShellWindow] [%s - %d] Error! my_popen returns: %d command: %s\n", __func__, __LINE__, *res, cmd.c_str());
|
||||
dprintf(DEBUG_NORMAL, "[CShellWindow] [%s:%d] Error! my_popen errno: %d command: %s\n", __func__, __LINE__, errno, cmd.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,10 @@ void CShellWindow::exec()
|
||||
//callback for line handler
|
||||
std::string s_output = std::string((output));
|
||||
OnShellOutputLoop(&s_output, res, &ok);
|
||||
dprintf(DEBUG_NORMAL, "[CShellWindow] [%s - %d] res=%d ok=%d\n", __func__, __LINE__, *res, ok);
|
||||
if (res)
|
||||
dprintf(DEBUG_NORMAL, "[CShellWindow] [%s:%d] res=%d ok=%d\n", __func__, __LINE__, *res, ok);
|
||||
else
|
||||
dprintf(DEBUG_NORMAL, "[CShellWindow] [%s:%d] res=NULL ok=%d\n", __func__, __LINE__, ok);
|
||||
|
||||
if (lines.size() > lines_max)
|
||||
lines.pop_front();
|
||||
|
Reference in New Issue
Block a user