Blob Blame History Raw
From 0fe8cc878224aa099d92951b77ea4cd993b9d728 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Wed, 4 Dec 2013 23:17:16 +0100
Subject: [PATCH] Fix build with -Werror=format-security

Fedora, starting with version 21, will enable this flag in order to limit
potentially insecure uses of format strings. It is required for format strings
to be constant now.
---
 shell/night_filter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shell/night_filter.c b/shell/night_filter.c
index 4f91d8d..0cb9a73 100644
--- a/shell/night_filter.c
+++ b/shell/night_filter.c
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
   CCD *ccd;
   char *host = NIGHT_LOCALHOST;
   float t;
-  char *indicator[] = { "-", "/", "|", "\\" };
+  char indicator[] = { '-', '/', '|', '\\' };
 
   host = getenv(NIGHTVIEW_HOST);
   if( host == NULL )
@@ -114,8 +114,8 @@ int main(int argc, char *argv[])
         for( t = 0.0; filter_status(ccd) == RUN && t < 5.0; t = t + 0.2   ) {
 	  if( prs ) {
 	    for(i=0; i< l;i++)
-	      printf("\b");
-	    l = printf(indicator[i%4]);
+	      putchar('\b');
+	    l = putchar(indicator[i%4]);
 	    fflush(stdout);
 	  }
           usleep(200000);
-- 
1.8.4.2