This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From fe302fd2dbf41058eb745541d7c971716075b13b Mon Sep 17 00:00:00 2001 | |
From: Benjamin Poulain <[email protected]> | |
Date: Thu, 1 Sep 2011 18:52:03 +0200 | |
Subject: [PATCH] Add parsing for the FormatVersion and the Creator lines. | |
The first two lines of a callgrind files are the optional lines for | |
the FormatVersion and Creator. | |
--- | |
Callgrind Viewer/FileLoader.h | 6 ++++ | |
Callgrind Viewer/FileLoader.m | 62 +++++++++++++++++++++++++++++++++++++++- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Callgrind Viewer/FileLoader.m b/Callgrind Viewer/FileLoader.m | |
index 823e128..2a6c906 100644 | |
--- a/Callgrind Viewer/FileLoader.m | |
+++ b/Callgrind Viewer/FileLoader.m | |
@@ -48,6 +48,7 @@ static inline ssize_t indexOfNextNewLineChar(const char* data, size_t offset, si | |
if ([_pendingDataBuffer length] > 0) { | |
ssize_t nextNewLine = indexOfNextNewLineChar(data, 0, size); | |
if (nextNewLine >= 0) { | |
+ assert(nextNewLine <= size); | |
[_pendingDataBuffer appendBytes:data length:nextNewLine]; |
NewerOlder