Blob Blame History Raw
diff -up ./coda-src/auth2/tokentool.c.orig ./coda-src/auth2/tokentool.c
--- ./coda-src/auth2/tokentool.c.orig	2006-05-24 16:20:16.000000000 -0400
+++ ./coda-src/auth2/tokentool.c	2013-12-04 15:15:58.576713587 -0500
@@ -40,7 +40,7 @@ static int read_int(char *question)
     while (1) {
         if (feof(stdin)) exit(-1);
 
-	fprintf(stdout, question);
+	fprintf(stdout, "%s", question);
 	fflush(stdout);
 
 	fgets(input_str, 80, stdin);
@@ -61,7 +61,7 @@ static float read_float(char *question)
     while (1) {
         if (feof(stdin)) exit(-1);
 
-	fprintf(stdout, question);
+	fprintf(stdout, "%s", question);
 	fflush(stdout);
 
 	fgets(input_str, 80, stdin);
@@ -80,7 +80,7 @@ char *read_string(char *question)
     char *resp = (char *)malloc(80+1);
 
     memset(resp, 0, 80);
-    fprintf(stdout, question);
+    fprintf(stdout, "%s", question);
     fflush(stdout);
     fgets(resp, 80, stdin);
     fflush(stdin);
diff -up ./coda-src/util/util.c.orig ./coda-src/util/util.c
--- ./coda-src/util/util.c.orig	2013-12-04 15:16:46.016046314 -0500
+++ ./coda-src/util/util.c	2013-12-04 15:16:06.660940700 -0500
@@ -46,6 +46,7 @@ extern "C" {
 #endif
 
 #include <stdio.h>
+#include <stdarg.h>
 #include <ctype.h>
 #include <math.h>
 #include "coda_string.h"
@@ -185,23 +186,20 @@ void fdprint(long afd, const char *fmt,
 void eprint(const char *fmt, ...)
 {
 	va_list ap;
-	char msg[240];
-	char *cp = msg;
 
 	/* Construct message in buffer and add newline */
 	va_start(ap, fmt);
-	vsnprintf(cp, 239, (const char *)fmt, ap); /* leave 1 char for the "\n" */
-	va_end(ap);
-	cp += strlen(cp);
-	strcat(cp, "\n");
 
 	/* Write to stderr & stdout*/
 	PrintTimeStamp(stdout); 
-	fprintf(stdout, msg); 
+	vfprintf(stdout, fmt, ap); 
+	printf(stdout, "\n");
 	fflush(stdout);
 	PrintTimeStamp(stderr);
-	fprintf(stderr, msg);
+	vfprintf(stderr, fmt, ap);
+	printf(stderr, "\n");
 	fflush(stderr);
+	va_end(ap);
 }