Make sure all output code paths set the locale information (Issue #61)

This commit is contained in:
Michael R Sweet
2024-01-27 19:23:51 -05:00
parent e882622233
commit b117959725
4 changed files with 19 additions and 4 deletions

View File

@@ -238,6 +238,7 @@ _pdfio_vsnprintf(pdfio_file_t *pdf, // I - PDF file
if ((decptr = strstr(temp, dec)) != NULL)
{
// Convert locale decimal point to "."
PDFIO_DEBUG("_pdfio_vsnprintf: Before \"%s\"\n", temp);
tempptr = decptr + strlen(dec);
if (tempptr > (decptr + 1))
memmove(decptr + 1, tempptr, strlen(tempptr) + 1);
@@ -249,6 +250,8 @@ _pdfio_vsnprintf(pdfio_file_t *pdf, // I - PDF file
if (*tempptr == '.')
*tempptr = '\0'; // Strip trailing decimal point
PDFIO_DEBUG("_pdfio_vsnprintf: After \"%s\"\n", temp);
}
// Copy to the output buffer
@@ -361,7 +364,7 @@ _pdfio_vsnprintf(pdfio_file_t *pdf, // I - PDF file
*bufptr = '\0';
}
fprintf(stderr, "_pdfio_vsnprintf: %ld \"%s\"\n", (long)bytes, buffer);
PDFIO_DEBUG("_pdfio_vsnprintf: Returning %ld \"%s\"\n", (long)bytes, buffer);
return (bytes);
}