Description: fix compilation with Debian's hardening compiler flags
 These are (on amd64): --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat
 -Wformat-security -Werror=format-security
Author: Damyan Ivanov <dmn@debian.org>

--- a/src/gpre/c_cxx.cpp
+++ b/src/gpre/c_cxx.cpp
@@ -164,6 +164,10 @@ static inline void set_sqlcode(const act
 		printa(column, "SQLCODE = isc_sqlcode(%s);", global_status_name);
 }
 
+#define PUTSAT(pos, what) \
+    align(pos); \
+    fputs( what, gpreGlob.out_file );
+
 //____________________________________________________________
 //
 //
@@ -1145,7 +1149,7 @@ static void gen_blr(void* /*user_arg*/,
 			}
 		}
 		*q1 = 0;
-		printa(indent, line);
+		PUTSAT(indent, line);
 		length = length - (q - p);
 		p = q;
 		if (first_line)
@@ -2726,12 +2730,12 @@ static void gen_raw(const UCHAR* blr, in
 		if (p < limit)
 			continue;
 		*p = 0;
-		printa(INDENT, buffer);
+		PUTSAT(INDENT, buffer);
 		p = buffer;
 	}
 
 	*p = 0;
-	printa(INDENT, buffer);
+	PUTSAT(INDENT, buffer);
 }
 
 
@@ -3499,7 +3503,7 @@ static void gen_variable( const act* act
 {
 	TEXT s[MAX_REF_SIZE];
 
-	printa(column, gen_name(s, action->act_object, false));
+	PUTSAT(column, gen_name(s, action->act_object, false));
 }
 
 
--- a/src/gpre/int_cxx.cpp
+++ b/src/gpre/int_cxx.cpp
@@ -631,7 +631,7 @@ static void gen_variable( const act* act
 	char s[MAX_REF_SIZE];
 
 	align(column);
-	fprintf(gpreGlob.out_file, gen_name(s, action->act_object));
+	fputs(gen_name(s, action->act_object), gpreGlob.out_file);
 
 }
 
--- a/src/gpre/pat.cpp
+++ b/src/gpre/pat.cpp
@@ -458,11 +458,11 @@ void PATTERN_expand( USHORT column, cons
 #endif
 
 	default:
-		fprintf(gpreGlob.out_file, buffer);
+		fputs(buffer, gpreGlob.out_file);
 		break;
 	}
 #else
-	fprintf(gpreGlob.out_file, buffer);
+	fputs(buffer, gpreGlob.out_file);
 #endif
 
 }
--- a/src/gpre/pretty.cpp
+++ b/src/gpre/pretty.cpp
@@ -294,7 +294,7 @@ static int error( ctl* control, SSHORT o
 
 	print_line(control, offset);
 	sprintf(control->ctl_ptr, string, arg);
-	fprintf(stderr, control->ctl_ptr);
+	fputs(control->ctl_ptr, stderr);
 	ADVANCE_PTR(control->ctl_ptr);
 	print_line(control, offset);
 
--- a/src/config/Args.cpp
+++ b/src/config/Args.cpp
@@ -177,7 +177,7 @@ void Args::printHelp(const char* helpTex
 	}
 
 	if (helpText)
-		printf (helpText);
+		puts (helpText);
 
 	printf ("Options are:\n");
 
@@ -201,7 +201,7 @@ bool Args::readPasswords(const char *msg
 	for (;;)
 	{
 		if (msg)
-			printf (msg);
+			puts (msg);
 		printf ("New password: ");
 		if (!fgets (pw1, length, stdin))
 			break;
@@ -241,7 +241,7 @@ bool Args::readPassword(const char *msg,
 	for (;;)
 	{
 		if (msg)
-			printf (msg);
+			puts (msg);
 		if (!fgets (pw1, length, stdin))
 			break;
 		char *p = strchr (pw1, '\n');
--- a/src/dudley/ddl.cpp
+++ b/src/dudley/ddl.cpp
@@ -718,7 +718,7 @@ bool DDL_yes_no( USHORT number)
 	}
 
 	for (;;) {
-		printf(prompt);
+		puts(prompt);
 		if (dudleyGlob.DDL_service)
 			putc('\001', stdout);
 		fflush(stdout);
--- a/src/dudley/lex.cpp
+++ b/src/dudley/lex.cpp
@@ -429,7 +429,7 @@ static int nextchar()
 	while (!(c = *DDL_char++)) {
 		DDL_char = DDL_buffer;
 		if (dudleyGlob.DDL_interactive) {
-			printf(dudleyGlob.DDL_prompt);
+			puts(dudleyGlob.DDL_prompt);
 			if (dudleyGlob.DDL_service)
 				putc('\001', stdout);
 			fflush(stdout);
--- a/src/qli/lex.cpp
+++ b/src/qli/lex.cpp
@@ -438,7 +438,7 @@ bool LEX_get_line(const TEXT* prompt, TE
 	// UNIX flavor
 
 	if (prompt)
-		printf(prompt);
+		puts(prompt);
 
 	errno = 0;
 	TEXT* p = buffer;
--- a/src/lock/print.cpp
+++ b/src/lock/print.cpp
@@ -294,7 +294,7 @@ int CLIB_ROUTINE main( int argc, char *a
 			switch (c)
 			{
 			case '?':
-				FPRINTF(outfile, usage);
+				FPRINTF(outfile, "%s", usage);
 				exit(FINI_OK);
 				break;
 
