From 18 Jan, 2021 0:00 UTC: All services will be temporary unavailable for maintenance

[Freewnn-users 102] Re: -Werror=format-security でビルド失敗

Back to archive index

Hideki Yamane henri****@debia*****
2012年 5月 31日 (木) 22:33:38 JST


On Thu, 31 May 2012 17:34:32 +0900
藤原 誠/ Makoto Fujiwara <makot****@ki*****> wrote:

> >                                                    藤原 誠
> こんなものではどうでしょうか ?
> 
> "%s" を加えただけです :-)

 藤原さん、ありがとうございます。
 他にもいくつか同様の警告が出たので、同じようにして黙らせてみました。

Index: freewnn-1.1.1~a021+cvs20100325/Wnn/jutil/wddel.c
===================================================================
--- freewnn-1.1.1~a021+cvs20100325.orig/Wnn/jutil/wddel.c	2012-05-31 22:00:49.079112665 +0900
+++ freewnn-1.1.1~a021+cvs20100325/Wnn/jutil/wddel.c	2012-05-31 22:01:14.151141002 +0900
@@ -95,7 +95,7 @@
 static void
 err ()
 {
-  printf ((char *) wnn_perror ());
+  printf ("%s", (char *) wnn_perror ());
   printf ("\n bye.\n");
   exit (1);
 }
Index: freewnn-1.1.1~a021+cvs20100325/Wnn/jutil/wdreg.c
===================================================================
--- freewnn-1.1.1~a021+cvs20100325.orig/Wnn/jutil/wdreg.c	2012-05-31 22:00:49.079112665 +0900
+++ freewnn-1.1.1~a021+cvs20100325/Wnn/jutil/wdreg.c	2012-05-31 22:01:14.151141002 +0900
@@ -95,7 +95,7 @@
 static void
 err ()
 {
-  printf ((char *) wnn_perror ());
+  printf ("%s", (char *) wnn_perror ());
   printf ("\n bye.\n");
   exit (1);
 }
Index: freewnn-1.1.1~a021+cvs20100325/Wnn/uum/select_ele.c
===================================================================
--- freewnn-1.1.1~a021+cvs20100325.orig/Wnn/uum/select_ele.c	2012-05-31 22:00:49.079112665 +0900
+++ freewnn-1.1.1~a021+cvs20100325/Wnn/uum/select_ele.c	2012-05-31 22:03:22.683286361 +0900
@@ -816,7 +816,7 @@
   /*
      sprintf(buf + strlen(buf), "_פ________ޤ___(Y/N)");
    */
-  sprintf (buf + strlen (buf), MSG_GET (24));
+  sprintf ("%s", buf + strlen (buf), MSG_GET (24));
   if (yes_or_no (buf) == 1)
     {
       if (jl_word_delete (bun_data_, word_searched[lc].dic_no, word_searched[lc].serial) == -1)
@@ -852,14 +852,14 @@
       /*
          sprintf(buf + strlen(buf), "_פλ__Ѥ__Ƴ____ޤ___(Y/N)");
        */
-      sprintf (buf + strlen (buf), MSG_GET (32));
+      sprintf ("%s", buf + strlen (buf), MSG_GET (32));
     }
   else
     {
       /*
          sprintf(buf + strlen(buf), "_פλ__Ѥ____ߤ__ޤ___(Y/N)");
        */
-      sprintf (buf + strlen (buf), MSG_GET (26));
+      sprintf ("%s", buf + strlen (buf), MSG_GET (26));
     }
   if (yes_or_no (buf) == 1)
     {
Index: freewnn-1.1.1~a021+cvs20100325/Wnn/uum/inspect.c
===================================================================
--- freewnn-1.1.1~a021+cvs20100325.orig/Wnn/uum/inspect.c	2002-03-30 10:45:41.000000000 +0900
+++ freewnn-1.1.1~a021+cvs20100325/Wnn/uum/inspect.c	2012-05-31 22:07:37.735575236 +0900
@@ -213,7 +213,7 @@
   sStrcpy (buf + strlen (buf), w_buf);
   set_escape_code (buf);
   strcat (buf, " ");
-  sprintf (buf + strlen (buf), MSG_GET (20));
+  sprintf ("%s", buf + strlen (buf), MSG_GET (20));
   /*
      sprintf(buf + strlen(buf), "_________ޤ___?(Y/N)");
    */
@@ -262,7 +262,7 @@
      strcpy(buf, "__");
    */
   sStrcpy (buf + strlen (buf), buf1);
-  sprintf (buf + strlen (buf), MSG_GET (24));
+  sprintf ("%s", buf + strlen (buf), MSG_GET (24));
   /*
      sprintf(buf + strlen(buf), "_פ________ޤ___(Y/N)");
    */
@@ -303,7 +303,7 @@
   buf1[kanji_len] = 0;
   sStrcpy (buf + strlen (buf), buf1);
   set_escape_code (buf);
-  sprintf (buf + strlen (buf), MSG_GET (26));
+  sprintf ("%s", buf + strlen (buf), MSG_GET (26));
   /*
      sprintf(buf + strlen(buf), "_פλ__Ѥ____ߤ__ޤ___(Y/N)");
    */




freewnn-users メーリングリストの案内
Back to archive index