Changeset 34165 in vbox
- Timestamp:
- Nov 18, 2010 12:23:15 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/linux/USBGetDevices.cpp
r33540 r34165 334 334 * Reads a string, i.e. allocates memory and copies it. 335 335 * 336 * We assume that a string is pure ASCII, if that's not the case 337 * tell me how to figure out the codeset please. 336 * We assume that a string is Utf8 and if that's not the case 337 * (pre-2.6.32-kernels used Latin-1, but so few devices return non-ASCII that 338 * this usually goes unnoticed) then we mercilessly force it to be so. 338 339 */ 339 340 static int usbReadStr(const char *pszValue, const char **ppsz) 340 341 { 342 char *psz; 343 341 344 if (*ppsz) 342 345 RTStrFree((char *)*ppsz); 343 *ppsz = RTStrDup(pszValue); 344 if (*ppsz) 346 psz = RTStrDup(pszValue); 347 if (psz) 348 { 349 RTStrPurgeEncoding(psz); 350 *ppsz = psz; 345 351 return VINF_SUCCESS; 352 } 346 353 return VERR_NO_MEMORY; 347 354 }
Note:
See TracChangeset
for help on using the changeset viewer.