Skip to content

Commit e0b290e

Browse files
bnason-nfhartwork
authored andcommitted
Add artificial scopes in xmltok.c utf8_toUtf8() to fix c89 compilation.
1 parent 205be33 commit e0b290e

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

expat/lib/xmltok.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,20 @@ utf8_toUtf8(const ENCODING *UNUSED_P(enc),
405405
}
406406

407407
/* Avoid copying partial characters (from incomplete input). */
408-
const char * const fromLimBefore = fromLim;
409-
align_limit_to_full_utf8_characters(*fromP, &fromLim);
410-
if (fromLim < fromLimBefore) {
411-
input_incomplete = true;
408+
{
409+
const char * const fromLimBefore = fromLim;
410+
align_limit_to_full_utf8_characters(*fromP, &fromLim);
411+
if (fromLim < fromLimBefore) {
412+
input_incomplete = true;
413+
}
412414
}
413415

414-
const ptrdiff_t bytesToCopy = fromLim - *fromP;
415-
memcpy(*toP, *fromP, bytesToCopy);
416-
*fromP += bytesToCopy;
417-
*toP += bytesToCopy;
416+
{
417+
const ptrdiff_t bytesToCopy = fromLim - *fromP;
418+
memcpy(*toP, *fromP, bytesToCopy);
419+
*fromP += bytesToCopy;
420+
*toP += bytesToCopy;
421+
}
418422

419423
if (output_exhausted) // needs to go first
420424
return XML_CONVERT_OUTPUT_EXHAUSTED;

0 commit comments

Comments
 (0)