libxlsxwriter/src/shared_strings.c in fast_excel-0.4.1 vs libxlsxwriter/src/shared_strings.c in fast_excel-0.5.0
- old
+ new
@@ -1,11 +1,11 @@
/*****************************************************************************
* shared_strings - A library for creating Excel XLSX sst files.
*
* Used in conjunction with the libxlsxwriter library.
*
- * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
+ * Copyright 2014-2022, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
*
*/
#include "xlsxwriter/xmlwriter.h"
#include "xlsxwriter/shared_strings.h"
@@ -143,12 +143,10 @@
uint8_t escaped_string = LXW_FALSE;
lxw_xml_start_tag(self->file, "si", NULL);
/* Look for and escape control chars in the string. */
- if (strpbrk(string, "\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C"
- "\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16"
- "\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F")) {
+ if (lxw_has_control_characters(string)) {
string = lxw_escape_control_characters(string);
escaped_string = LXW_TRUE;
}
/* Write the t element. */