From dd9de3dff0a3bd826ae6b4b6060964c3fad218af Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sun, 23 Jun 2013 14:32:47 +0000 Subject: [PATCH] Update (currently un-used) save_digraphs() function so that it compiles cleanly with -Werror=format-security. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@245 13b04d17-f746-0410-82c6-800466cd88b0 --- source/translat.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/source/translat.c b/source/translat.c index edfd6da..4b1b4fd 100644 --- a/source/translat.c +++ b/source/translat.c @@ -407,23 +407,16 @@ void save_digraphs(FILE *fp) { if (digraph_changed) { + int i; - int i = 0; - char *command = "\nDIGRAPH -ADD "; - - fprintf(fp, "DIGRAPH -CLEAR"); - fprintf(fp, command); - while(1) - { + fputs("DIGRAPH -CLEAR", fp); + for (i = 0; dig_table_lo[i]; i++) { + if (!(i % 5)) + fputs("\nDIGRAPH -ADD ", fp); fprintf(fp, "%d %d %d ", dig_table_lo[i], dig_table_hi[i], dig_table_di[i]); - if (!dig_table_lo[++i]) - break; - if (!(i % 5)) - fprintf(fp, command); } fputc('\n', fp); - } }