summaryrefslogtreecommitdiff
path: root/export_xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'export_xml.c')
-rw-r--r--export_xml.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/export_xml.c b/export_xml.c
index ffdeffc..4485f9d 100644
--- a/export_xml.c
+++ b/export_xml.c
@@ -24,7 +24,7 @@ int export_xml(struct channel_t *channel, struct user_t *users) {
xmlNodePtr hour_node = xmlNewChild(lines_node, NULL, "hour", NULL);
for(int q = 0; q < 4; q++) {
char s[0xf];
- sprintf(s, "%d", channel->hours[h*4 + q]);
+ snprintf(s, 0xf, "%d", channel->hours[h*4 + q]);
xmlNewChild(hour_node, NULL, "quarter", s);
}
}
@@ -39,7 +39,7 @@ int export_xml(struct channel_t *channel, struct user_t *users) {
xmlNodePtr user_node = xmlNewChild(users_node, NULL, "user", NULL);
xmlNewChild(user_node, NULL, "nick", user->nick);
- sprintf(s, "%d", user->words);
+ snprintf(s, 0xf, "%d", user->words);
xmlNewChild(user_node, NULL, "words", s);
/* Add lines for this user. */
@@ -47,7 +47,7 @@ int export_xml(struct channel_t *channel, struct user_t *users) {
for(int h = 0; h < 24; h++) {
xmlNodePtr hour_node = xmlNewChild(lines_node, NULL, "hour", NULL);
for(int q = 0; q < 4; q++) {
- sprintf(s, "%d", user->lines[h*4 + q]);
+ snprintf(s, 0xf, "%d", user->lines[h*4 + q]);
xmlNewChild(hour_node, NULL, "quarter", s);
}
}
@@ -64,7 +64,7 @@ int export_xml(struct channel_t *channel, struct user_t *users) {
xmlNodePtr word_node = xmlNewChild(words_node, NULL, "word", NULL);
xmlNewChild(word_node, NULL, "name", word->name);
- sprintf(s, "%d", word->count);
+ snprintf(s, 0xf, "%d", word->count);
xmlNewChild(word_node, NULL, "count", s);
word = word->next;