Browse Source

Solving variables not declared at beginning of the scope, introduced by Expat 2.2.4

Source commit: ba1362aff735b1da382e8207c338222645ad9bee
Martin Prikryl 8 years ago
parent
commit
857f33053c
1 changed files with 4 additions and 2 deletions
  1. 4 2
      libs/expat/lib/xmltok.c

+ 4 - 2
libs/expat/lib/xmltok.c

@@ -393,6 +393,8 @@ utf8_toUtf8(const ENCODING *UNUSED_P(enc),
             const char **fromP, const char *fromLim,
             char **toP, const char *toLim)
 {
+  const char * fromLimBefore;
+  ptrdiff_t bytesToCopy;
   bool input_incomplete = false;
   bool output_exhausted = false;
 
@@ -405,13 +407,13 @@ utf8_toUtf8(const ENCODING *UNUSED_P(enc),
   }
 
   /* Avoid copying partial characters (from incomplete input). */
-  const char * const fromLimBefore = fromLim;
+  fromLimBefore = fromLim;
   align_limit_to_full_utf8_characters(*fromP, &fromLim);
   if (fromLim < fromLimBefore) {
     input_incomplete = true;
   }
 
-  const ptrdiff_t bytesToCopy = fromLim - *fromP;
+  bytesToCopy = fromLim - *fromP;
   memcpy((void *)*toP, (const void *)*fromP, (size_t)bytesToCopy);
   *fromP += bytesToCopy;
   *toP += bytesToCopy;