summaryrefslogtreecommitdiff
path: root/desktop/unx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-11-08 20:49:07 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-08 20:49:31 +0100
commitde90369c315afc62c4409a5df1a581fa466cb849 (patch)
treeb620d46b4a87fc7478b7717d2f19928a47fba3fd /desktop/unx
parenta57304a53832adf0c8a32b0c53d9be5b55507ab1 (diff)
Properly check sscanf return value.
Diffstat (limited to 'desktop/unx')
-rw-r--r--desktop/unx/source/start.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 9d95547856b4..b30efdca7e93 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -559,6 +559,7 @@ read_percent( ChildInfo *info, int *pPercent )
char *pBegin;
char *pIter;
+ char c;
/* from the last call */
int nNotProcessed = nRead - ( pNext - pBuffer );
@@ -598,7 +599,7 @@ read_percent( ChildInfo *info, int *pPercent )
return ProgressExit;
else if ( !strncasecmp( pBegin, "restart", 7 ) )
return ProgressRestart;
- else if ( sscanf( pBegin, "%d%%", pPercent ) )
+ else if ( sscanf( pBegin, "%d%c", pPercent, &c ) == 2 && c == '%' )
return ProgressContinue;
/* unexpected - let's exit the splash to be safe */