diff --git a/libraries/systeminfo/src/sys_apple.cpp b/libraries/systeminfo/src/sys_apple.cpp index 2d7d6083..7fc0017b 100644 --- a/libraries/systeminfo/src/sys_apple.cpp +++ b/libraries/systeminfo/src/sys_apple.cpp @@ -4,6 +4,7 @@ #include #include +#include Sys::KernelInfo Sys::getKernelInfo() { @@ -23,11 +24,17 @@ Sys::KernelInfo Sys::getKernelInfo() auto sections = release.split('-'); if(sections.size() >= 1) { auto versionParts = sections[0].split('.'); - if(sections.size() >= 3) { + if(versionParts.size() >= 3) { out.kernelMajor = sections[0].toInt(); out.kernelMinor = sections[1].toInt(); out.kernelPatch = sections[2].toInt(); } + else { + qWarning() << "Not enough version numbers in " << sections[0] << " found " << versionParts.size(); + } + } + else { + qWarning() << "Not enough '-' sections in " << release << " found " << sections.size(); } return out; } diff --git a/libraries/systeminfo/src/sys_unix.cpp b/libraries/systeminfo/src/sys_unix.cpp index 303ead1f..cba52cfb 100644 --- a/libraries/systeminfo/src/sys_unix.cpp +++ b/libraries/systeminfo/src/sys_unix.cpp @@ -8,6 +8,7 @@ #include #include +#include Sys::KernelInfo Sys::getKernelInfo() { @@ -28,11 +29,17 @@ Sys::KernelInfo Sys::getKernelInfo() auto sections = release.split('-'); if(sections.size() >= 1) { auto versionParts = sections[0].split('.'); - if(sections.size() >= 3) { + if(versionParts.size() >= 3) { out.kernelMajor = sections[0].toInt(); out.kernelMinor = sections[1].toInt(); out.kernelPatch = sections[2].toInt(); } + else { + qWarning() << "Not enough version numbers in " << sections[0] << " found " << versionParts.size(); + } + } + else { + qWarning() << "Not enough '-' sections in " << release << " found " << sections.size(); } return out; }