From acbd505cfe63d0cac1f850b167783b982f2e4e2f Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Fri, 10 Aug 2012 19:36:06 +0800 Subject: [PATCH] Avoided modifying a constant string --- src/xsllocator.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/xsllocator.cpp b/src/xsllocator.cpp index 69346ef..6758983 100755 --- a/src/xsllocator.cpp +++ b/src/xsllocator.cpp @@ -45,12 +45,8 @@ void XMLCALL XslLocator::processingInstructionHandler ( if ( strcmp ( target, "xml-stylesheet" ) ) return; - char *value, *iterator; -#ifdef __WXMSW__ + const char *value, *iterator; value = strstr ( ( const char * ) data, "href=" ); -#else - value = ( char *) strstr ( data, "href=" ); -#endif if ( !value || strlen ( value ) < 7 ) return; value += 6; @@ -63,7 +59,7 @@ void XMLCALL XslLocator::processingInstructionHandler ( } } - d->xslLocation = std::string ( value, iterator - value ); + d->xslLocation.assign( value, iterator - value ); XML_StopParser ( d->parser, false ); }