git-svn-id: svn://db.shs.com.ru/pip@770 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -376,11 +376,11 @@ void PIString::buildData(const char * cp) const {
|
||||
|
||||
void PIString::trimsubstr(int &st, int &fn) const {
|
||||
for (int i = 0; i < length(); ++i)
|
||||
if (at(i) != ' ' && at(i) != '\t' && at(i) != '\n' && at(i) != '\r' && at(i) != char(12))
|
||||
if (at(i) != ' ' && at(i) != '\t' && at(i) != '\n' && at(i) != '\r' && at(i) != char(12) && at(i) != uchar(0))
|
||||
{st = i; break;}
|
||||
if (st < 0) return;
|
||||
for (int i = length() - 1; i >= 0; --i)
|
||||
if (at(i) != ' ' && at(i) != '\t' && at(i) != '\n' && at(i) != '\r' && at(i) != char(12))
|
||||
if (at(i) != ' ' && at(i) != '\t' && at(i) != '\n' && at(i) != '\r' && at(i) != char(12) && at(i) != uchar(0))
|
||||
{fn = i; break;}
|
||||
}
|
||||
|
||||
|
||||
@@ -793,7 +793,7 @@ PIStringList PISerial::availableDevices(bool test) {
|
||||
DWORD name_len = 1024, data_len = 1024, type = 0;
|
||||
ret = RegEnumValue(key, index, (LPTSTR)name, &name_len, NULL, &type, (uchar * )data, &data_len);
|
||||
if (ret == ERROR_NO_MORE_ITEMS) break;
|
||||
dl << PIString(data, data_len);
|
||||
dl << PIString(data, data_len).trim();
|
||||
index++;
|
||||
}
|
||||
RegCloseKey(key);
|
||||
|
||||
Reference in New Issue
Block a user