mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
Merge branch 'master' of ssh://github.com/fluxer/kdelibs
This commit is contained in:
commit
06e562e271
1 changed files with 6 additions and 1 deletions
|
@ -289,7 +289,12 @@ QByteArray DevinfoDevice::stringByName(const char* sysctlname)
|
|||
// qWarning() << "sysctlbyname failed" << sysctlname;
|
||||
return QByteArray();
|
||||
}
|
||||
return QByteArray(sysctlbuff, sysctlbuffsize);
|
||||
QByteArray result(sysctlbuff, sysctlbuffsize);
|
||||
// chop non-printable character at the end, whatever it is
|
||||
if (!result.isEmpty() && !::isprint(result.at(result.size() - 1))) {
|
||||
result.chop(1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
qlonglong DevinfoDevice::integerByName(const char* sysctlname)
|
||||
|
|
Loading…
Add table
Reference in a new issue