summaryrefslogtreecommitdiffstats
path: root/src/xlsx.c
diff options
context:
space:
mode:
authordave <ydrah32@gmail.com>2019-01-13 07:33:17 -0600
committerdave <ydrah32@gmail.com>2019-01-13 07:33:17 -0600
commit820079e4977f02dfd20cb25f38e412da2ff874bb (patch)
treeb3cc31c1fc575a6555f5dee94eecdbdb9297d836 /src/xlsx.c
parent3aebe4162b549f97c3195c4898f69b0ca924145f (diff)
better sheet name buffer length
Diffstat (limited to 'src/xlsx.c')
-rw-r--r--src/xlsx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xlsx.c b/src/xlsx.c
index 229c5ae..26d53e6 100644
--- a/src/xlsx.c
+++ b/src/xlsx.c
@@ -418,7 +418,7 @@ int open_xlsx(char * fname, char * encoding) {
//open xml file with sheet names
name = "xl/workbook.xml";
- char namebuf[256];
+ char namebuf[30];
int found = 0;
zf = zip_fopen(za, name, ZIP_FL_UNCHANGED);
@@ -442,7 +442,7 @@ int open_xlsx(char * fname, char * encoding) {
while (cur_node != NULL && cur_node->next != NULL && strcmp((char *) xmlGetProp(cur_node, (xmlChar *) "name"), get_conf_value("sheet")))
cur_node = cur_node->next;
if ( ! strcmp((char *)xmlGetProp(cur_node, (xmlChar *) "name"),get_conf_value("sheet")) ){
- snprintf(namebuf,256,"xl/worksheets/sheet%s.xml",xmlGetProp(cur_node, (xmlChar *) "sheetId"));
+ snprintf(namebuf,30,"xl/worksheets/sheet%s.xml",xmlGetProp(cur_node, (xmlChar *) "sheetId"));
name = namebuf;
found = 1;
}
@@ -456,7 +456,7 @@ int open_xlsx(char * fname, char * encoding) {
int i = strlen(name)-1;
while( --i >= 0 && isdigit(name[i]) > 0 );
name = i < 0 ? "sheet":"";
- snprintf(namebuf,256,"xl/worksheets/%s%s.xml",name,get_conf_value("sheet"));
+ snprintf(namebuf,30,"xl/worksheets/%s%s.xml",name,get_conf_value("sheet"));
name = namebuf;
}
} else {