From 78d4babed7e888b7ee2ae710482c9ada75814578 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Sun, 22 Sep 2013 18:49:37 +0000 Subject: [PATCH] Do not advance start and get startType if we are at the end anyway. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@37134 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Modules/Parsers/ProjectCenter/PCParser.m | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39edd1c..12a0a9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-09-22 Riccardo Mottola + + * Modules/Parsers/ProjectCenter/PCParser.m + Do not advance start and get startType if we are at the end anyway. + 2013-09-21 Riccardo Mottola * Modules/Parsers/ProjectCenter/PCParser.h diff --git a/Modules/Parsers/ProjectCenter/PCParser.m b/Modules/Parsers/ProjectCenter/PCParser.m index 4b5bda8..3d56d5b 100644 --- a/Modules/Parsers/ProjectCenter/PCParser.m +++ b/Modules/Parsers/ProjectCenter/PCParser.m @@ -202,8 +202,13 @@ CodeType codeType(unichar *ch) (*impInvisible)(_handler, selInvisible, _uchar[start+j]); } } - start = i; - startType = codeType(_uchar+start); + /* if we are at the end, we can getting the last stat char anyway + and in any case it would not be valid */ + if (end != _length) + { + start = i; + startType = codeType(_uchar+start); + } } } NSLog(@"CodeParser end...");