C++: Fix hexadecimals in quick fix

Task-number: QTCREATORBUG-6240
Change-Id: Id3dc48d47f88017b3bc9e026c8e5552d2e9f4d48
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
Leandro Melo
2011-10-12 13:47:35 +02:00
committed by Leandro T. C. Melo
parent c436e63ba7
commit 87943ca61c
3 changed files with 12 additions and 1 deletions

View File

@@ -60,6 +60,7 @@
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cpprefactoringchanges.h>
#include <cpptools/insertionpointlocator.h>
#include <cpptools/cpptoolsreuse.h>
#include <extensionsystem/iplugin.h>
#include <QtCore/QFileInfo>
@@ -1282,7 +1283,7 @@ public:
// remove trailing L or U and stuff
const char * const spell = numeric->chars();
int numberLength = numeric->size();
while (numberLength > 0 && (spell[numberLength-1] < '0' || spell[numberLength-1] > 'F'))
while (numberLength > 0 && !isHexadecimal(spell[numberLength - 1]))
--numberLength;
if (numberLength < 1)
return result;