Changeset 14740 in vbox
- Timestamp:
- Nov 27, 2008 7:57:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp
r14736 r14740 245 245 com::SafeArray<BSTR> baseMetrics; 246 246 com::SafeIfaceArray<IUnknown> objects; 247 ULONGperiod = 1, samples = 1;247 uint32_t period = 1, samples = 1; 248 248 bool listMatches = false; 249 249 int i; … … 255 255 if (argc <= i + 1) 256 256 return errorArgument("Missing argument to '%s'", argv[i]); 257 char *endptr = NULL; 258 period = strtoul (argv[++i], &endptr, 10); 259 if (!endptr || *endptr || !period) 257 if ( VINF_SUCCESS != RTStrToUInt32Full(argv[++i], 10, &period) 258 || !period) 260 259 return errorArgument("Invalid value for 'period' parameter: '%s'", argv[i]); 261 260 } … … 264 263 if (argc <= i + 1) 265 264 return errorArgument("Missing argument to '%s'", argv[i]); 266 char *endptr = NULL; 267 samples = strtoul (argv[++i], &endptr, 10); 268 if (!endptr || *endptr) 265 if ( VINF_SUCCESS != RTStrToUInt32Full(argv[++i], 10, &samples) 266 || !samples) 269 267 return errorArgument("Invalid value for 'samples' parameter: '%s'", argv[i]); 270 268 } … … 413 411 com::SafeArray<BSTR> baseMetrics; 414 412 com::SafeIfaceArray<IUnknown> objects; 415 ULONGperiod = 1, samples = 1;413 uint32_t period = 1, samples = 1; 416 414 bool isDetached = false, listMatches = false; 417 415 int i; … … 422 420 if (argc <= i + 1) 423 421 return errorArgument("Missing argument to '%s'", argv[i]); 424 char *endptr = NULL; 425 period = strtoul (argv[++i], &endptr, 10); 426 if (!endptr || *endptr || !period) 422 if ( VINF_SUCCESS != RTStrToUInt32Full(argv[++i], 10, &period) 423 || !period) 427 424 return errorArgument("Invalid value for 'period' parameter: '%s'", argv[i]); 428 425 } … … 431 428 if (argc <= i + 1) 432 429 return errorArgument("Missing argument to '%s'", argv[i]); 433 char *endptr = NULL; 434 samples = strtoul (argv[++i], &endptr, 10); 435 if (!endptr || *endptr || !samples) 430 if ( VINF_SUCCESS != RTStrToUInt32Full(argv[++i], 10, &samples) 431 || !samples) 436 432 return errorArgument("Invalid value for 'samples' parameter: '%s'", argv[i]); 437 433 }
Note:
See TracChangeset
for help on using the changeset viewer.