浏览代码

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

Source commit: ba1362aff735b1da382e8207c338222645ad9bee
Martin Prikryl 8 年之前
父节点
当前提交
857f33053c
共有 1 个文件被更改,包括 4 次插入2 次删除
  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;