summaryrefslogtreecommitdiff
path: root/xml2tsv.c
diff options
context:
space:
mode:
Diffstat (limited to 'xml2tsv.c')
-rw-r--r--xml2tsv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xml2tsv.c b/xml2tsv.c
index 9418d66..298d0c5 100644
--- a/xml2tsv.c
+++ b/xml2tsv.c
@@ -1,7 +1,7 @@
/*
* (c) 2020 Vincenzo "KatolaZ" Nicosia <katolaz@freaknet.org>
*
-* A simple xml-to-rsv converter, based on xmlparser by Hiltjo Posthuma
+* A simple xml-to-tsv converter, based on xmlparser by Hiltjo Posthuma
* http://codemadness.org/git/xmlparser/
*
* You can use, distribute, modify, and/or redistribute this program under
@@ -31,7 +31,8 @@ typedef struct {
int stack_push(tstack_t *t, const char *c){
if (t->top < DEPTH_MAX){
t->top ++;
- strncpy(t->st[t->top], c, STR_MAX);
+ strncpy(t->st[t->top], c, STR_MAX - 1);
+ *(t->st[t->top] + STR_MAX) = '\0';
return 0;
}
return -1;