Changeset 16337 in vbox for trunk/src/VBox/HostServices/GuestProperties
- Timestamp:
- Jan 28, 2009 9:03:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
r14461 r16337 454 454 /* Work around silly constant issues - we ought to allow passing 455 455 * constant strings in the hgcm parameters. */ 456 char szName[MAX_NAME_LEN] = "";457 char szValue[MAX_VALUE_LEN] = "";458 char szFlags[MAX_FLAGS_LEN] = "";459 strncat(szName, setProperties[i].pcszName, sizeof(szName));460 strncat(szValue, setProperties[i].pcszValue, sizeof(szValue));461 strncat(szFlags, setProperties[i].pcszFlags, sizeof(szFlags));456 char szName[MAX_NAME_LEN]; 457 char szValue[MAX_VALUE_LEN]; 458 char szFlags[MAX_FLAGS_LEN]; 459 RTStrPrintf(szName, sizeof(szName), "%s", setProperties[i].pcszName); 460 RTStrPrintf(szValue, sizeof(szValue), "%s", setProperties[i].pcszValue); 461 RTStrPrintf(szFlags, sizeof(szFlags), "%s", setProperties[i].pcszFlags); 462 462 paParms[0].setPointer (szName, (uint32_t)strlen(szName) + 1); 463 463 paParms[1].setPointer (szValue, (uint32_t)strlen(szValue) + 1); … … 530 530 /* Work around silly constant issues - we ought to allow passing 531 531 * constant strings in the hgcm parameters. */ 532 char szName[MAX_NAME_LEN] = "";533 strncat(szName, delProperties[i].pcszName, sizeof(szName));532 char szName[MAX_NAME_LEN]; 533 RTStrPrintf(szName, sizeof(szName), "%s", delProperties[i].pcszName); 534 534 paParms[0].setPointer (szName, (uint32_t)strlen(szName) + 1); 535 535 if (delProperties[i].isHost) … … 608 608 AssertBreakStmt(sizeof(szBuffer) >= getProperties[i].cchValue, 609 609 rc = VERR_INTERNAL_ERROR); 610 strncat(szName, getProperties[i].pcszName, sizeof(szName));610 RTStrPrintf(szName, sizeof(szName), "%s", getProperties[i].pcszName); 611 611 paParms[0].setPointer (szName, (uint32_t)strlen(szName) + 1); 612 612 paParms[1].setPointer (szBuffer, sizeof(szBuffer));
Note:
See TracChangeset
for help on using the changeset viewer.