--- lshw-B.02.14/src/core/hw.cc 2009-02-12 17:53:09.000000000 -0500 +++ lshw-B.02.14_FIXED/src/core/hw.cc 2010-10-07 19:05:42.000000000 -0400 @@ -46,13 +46,17 @@ string hw::strip(const string & s) { string result = s; + size_t i = result.find('\0'); + + if(i != string::npos) + result = result.substr(0, i); while ((result.length() > 0) && ((uint8_t)result[0] <= ' ')) result.erase(0, 1); while ((result.length() > 0) && ((uint8_t)result[result.length() - 1] <= ' ')) result.erase(result.length() - 1); - for (unsigned int i = 0; i < result.length(); i++) + for (i = 0; i < result.length(); i++) if ((uint8_t)result[i] < ' ') { result.erase(i, 1);