Description: Fix FTBFS with -Werror=format-security.
Author: Colin Watson <cjwatson@ubuntu.com>
Bug-Debian: http://bugs.debian.org/645896
Forwarded: no
Last-Update: 2011-10-19

--- a/ocr-bpnet/bpnet.cc
+++ b/ocr-bpnet/bpnet.cc
@@ -523,7 +523,7 @@
                                                 " for epoch %d",ep);
                 logger_confusion_test.confusion(cm);
             }
-            printf(temp_string);logger_errors(temp_string);
+            fputs(temp_string, stdout);logger_errors(temp_string);
         }
 
 
@@ -556,11 +556,11 @@
 
             sprintf(temp_string, "ep:%d nh:%d lr:%g tp:%g np:%d i:%d o:%d\n",
                     epochs,nhidden,learningrate,testportion,n,ninput,noutput);
-            printf(temp_string);logger_errors(temp_string);
+            fputs(temp_string, stdout);logger_errors(temp_string);
 
             sprintf(temp_string, "=== Start training on %d samples "
                     "(testing on %d) for %d epochs ===\n",ntrain,ntest,epochs);
-            printf(temp_string);logger_errors(temp_string);
+            fputs(temp_string, stdout);logger_errors(temp_string);
 
             //local copy of the current mlp
             floatarray weights_hidden_input_temp;
@@ -570,7 +570,7 @@
 
             float old_train_error = 0.0f;
             sprintf(temp_string, "Epoch: %d\tLR: %f\n\n",0,learningrate);
-            printf(temp_string);logger_errors(temp_string);
+            fputs(temp_string, stdout);logger_errors(temp_string);
 
             test_on_db(0,ntrain,train_error,train_cls_error,*confusion_train);
             old_train_error = best_train_error = train_error;
@@ -592,7 +592,7 @@
 
             for(int epoch=0;epoch<epochs;epoch++) {
                 sprintf(temp_string, "Epoch: %d\tLR: %f\n",epoch+1,learningrate);
-                printf(temp_string);logger_errors(temp_string);
+                fputs(temp_string, stdout);logger_errors(temp_string);
                 //confusion_test->printReduced(stdout);
                 //keep current network in memory
                 copy(weights_hidden_input_temp, weights_hidden_input);
--- a/ocr-utils/logger.cc
+++ b/ocr-utils/logger.cc
@@ -433,7 +433,7 @@
                     if(((trans_t(i)-prev_t(i)) == size) &&
                         (prev_t(i)%size == indent) && (trans==prev_t(i))) {
                         sprintf(temp,"<td valign=\"top\" colspan=%d><center>",size);
-                        fprintf(get_log()->file, temp);
+                        fputs(temp, get_log()->file);
                         if(id_t(i) == 0) {                              // special case: id=0 means white space or \n
                             fprintf(get_log()->file, "<br>White Space");
                         } else {
@@ -449,7 +449,7 @@
                             sprintf(temp, "<td><font size=\"-1\">%s</font></td><td>"
                                 "<font size=\"-1\">%.3f</font></td></tr>", buf, cost_t(i+j));
                             delete[] buf;
-                            fprintf(get_log()->file, temp);
+                            fputs(temp, get_log()->file);
                             if ((i+j+1>=n) || (cuts(i+j+1) == 0)) {
                                 break;                  // cannot display more than possible number of transitions
                             }
