From 75ce59d010c92a89453136300ec2c5f9c8e42c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Fri, 3 Oct 2014 23:23:01 +0200 Subject: [PATCH] oc-rtf: Fix current position to match where _bytes pointer is This avoids to have extra unknown bytes at the end of the RTF document as _len would have been reached but _current_pos had incorrect less value. --- OpenChange/RTFHandler.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenChange/RTFHandler.m b/OpenChange/RTFHandler.m index 91d7fd2d8..fbcea8121 100644 --- a/OpenChange/RTFHandler.m +++ b/OpenChange/RTFHandler.m @@ -756,16 +756,16 @@ const unsigned short ansicpg874[256] = { { // We rewind our buffer so we start at the beginning of {\fonttbl... _bytes = cw-2; - _current_pos -= 10; + _current_pos -= 9; // Length: {\fonttbl fontTable = [self parseFontTable]; - // We go back 1 byte in order to end our section properly ('}' character + // We go back 1 byte in order to end our section properly ('}' character) REWIND; } else if (strncmp(cw, "stylesheet", 10) == 0) { _bytes = cw-2; - _current_pos -= 13; + _current_pos -= 12; // Length: {\stylesheet [self parseStyleSheet]; REWIND; } @@ -776,7 +776,7 @@ const unsigned short ansicpg874[256] = { else if (strncmp(cw, "pict", 4) == 0) { _bytes = cw-2; - _current_pos -= 7; + _current_pos -= 6; // Length: {\pict [self parsePicture]; REWIND; }