fix win2003 crash

This commit is contained in:
Doug MacEachern 2005-01-28 16:33:12 +00:00
parent 8af784d4eb
commit 7f15d07b45
1 changed files with 2 additions and 5 deletions

View File

@ -122,12 +122,9 @@ static PERF_OBJECT_TYPE *get_perf_object(sigar_t *sigar, char *counter_key,
* confucius say what the fuck.
*/
if (object->NumInstances == PERF_NO_INSTANCES) {
bytes =
(block->TotalByteLength -
block->HeaderLength -
object->TotalByteLength);
int i;
for (; bytes > 0; bytes -= object->TotalByteLength) {
for (i=0; i<block->NumObjectTypes; i++) {
if (object->NumInstances != PERF_NO_INSTANCES) {
return object;
}