Permalink
Browse files

Add artificial scopes in xmltok.c utf8_toUtf8() to fix c89 compilation.

  • Loading branch information...
bnason-nf authored and hartwork committed Aug 21, 2017
1 parent 205be33 commit e0b290eb3d8f4c4b45137a7d7f4f8db812145bd2
Showing with 12 additions and 8 deletions.
  1. +12 −8 expat/lib/xmltok.c
View
@@ -405,16 +405,20 @@ utf8_toUtf8(const ENCODING *UNUSED_P(enc),
}
/* Avoid copying partial characters (from incomplete input). */
const char * const fromLimBefore = fromLim;
align_limit_to_full_utf8_characters(*fromP, &fromLim);
if (fromLim < fromLimBefore) {
input_incomplete = true;
{
const char * const fromLimBefore = fromLim;
align_limit_to_full_utf8_characters(*fromP, &fromLim);
if (fromLim < fromLimBefore) {
input_incomplete = true;
}
}
const ptrdiff_t bytesToCopy = fromLim - *fromP;
memcpy(*toP, *fromP, bytesToCopy);
*fromP += bytesToCopy;
*toP += bytesToCopy;
{
const ptrdiff_t bytesToCopy = fromLim - *fromP;
memcpy(*toP, *fromP, bytesToCopy);
*fromP += bytesToCopy;
*toP += bytesToCopy;
}
if (output_exhausted) // needs to go first
return XML_CONVERT_OUTPUT_EXHAUSTED;

0 comments on commit e0b290e

Please sign in to comment.