From e1379e29e21c7eabf6abf19a1f1f46163251b2a8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 Mar 2007 13:22:18 +0000 Subject: [PATCH] don't return junk from wxGetOsVersion() if we failed to execute 'uname -r' (thanks coverity) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/utilsunx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 73148ac613..ff387a5124 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -915,9 +915,9 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) // get OS version int major, minor; wxString release = wxGetCommandOutput(wxT("uname -r")); - if ( !release.empty() && wxSscanf(release, wxT("%d.%d"), &major, &minor) != 2 ) + if ( release.empty() || wxSscanf(release, wxT("%d.%d"), &major, &minor) != 2 ) { - // unrecognized uname string format + // failed to get version string or unrecognized format major = minor = -1; } -- 2.45.2