aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/util.cpp4
-rw-r--r--common/util.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/common/util.cpp b/common/util.cpp
index 75f7f82efa..787e0736f9 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -91,11 +91,11 @@ String StringTokenizer::nextToken() {
//
// Print hexdump of the data passed in
//
-void hexdump(const byte * data, int len, int bytesPerLine) {
+void hexdump(const byte * data, int len, int bytesPerLine, int startOffset) {
assert(1 <= bytesPerLine && bytesPerLine <= 32);
int i;
byte c;
- int offset = 0;
+ int offset = startOffset;
while (len >= bytesPerLine) {
printf("%06x: ", offset);
for (i = 0; i < bytesPerLine; i++) {
diff --git a/common/util.h b/common/util.h
index 3b2a705d6c..a7d6260583 100644
--- a/common/util.h
+++ b/common/util.h
@@ -96,8 +96,9 @@ private:
* @param data the data to be dumped
* @param len the lenght of that data
* @param bytesPerLine number of bytes to print per line (default: 16)
+ * @param startOffset shift the shown offsets by the starting offset (default: 0)
*/
-extern void hexdump(const byte * data, int len, int bytesPerLine = 16);
+extern void hexdump(const byte * data, int len, int bytesPerLine = 16, int startOffset = 0);
/**