Changeset 222 for Evidence/Evidence.cc
- Timestamp:
- 06/08/10 13:14:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Evidence/Evidence.cc
r221 r222 388 388 389 389 memcpy(Buffer, R.getData(), BufferSize); 390 DataStart = Buffer + strlen(Buffer) + 1; 390 391 Rewind(); 391 392 … … 399 400 400 401 // Check for wrap around 401 if (memcmp(Pointer, &WrapMark, sizeof(WrapMark)) == 0) Pointer = (struct Item *) (Buffer + 4); 402 402 if (memcmp(Pointer, &WrapMark, sizeof(WrapMark)) == 0) Pointer = (struct Item *) (DataStart + sizeof(int)); 403 403 // Check if at end of ring buffer 404 404 if (memcmp(Pointer, &EndMark, sizeof(EndMark)) == 0) return NULL; 405 405 406 406 const struct Item *Ret = Pointer; 407 Pointer = (struct Item *) ((char *) ( Pointer + 1) + Pointer->Size);407 Pointer = (struct Item *) ((char *) (Ret + 1) + Ret->Size); 408 408 409 409 return Ret; … … 413 413 void EvidenceHistory::Rewind() { 414 414 415 if (Buffer != NULL) Pointer = (struct Item *) (Buffer + (*(int *) Buffer)); 416 } 415 if (Buffer != NULL) Pointer = (struct Item *) (DataStart + (*(int *) DataStart)); 416 } 417 418 // Return DIM format string of service (NULL if no data) 419 char *EvidenceHistory::GetFormat() { 420 421 return Buffer; 422 }
Note:
See TracChangeset
for help on using the changeset viewer.