9b7ab2cca3b71cc86e81716e7e9bb036e86dc044
[feed/packages.git] / libs / libidn / patches / 010-fix-idn-error-usage.patch
1 --- a/src/idn.c
2 +++ b/src/idn.c
3 @@ -169,7 +169,7 @@ main (int argc, char *argv[])
4 (args_info.idna_to_unicode_given ? 1 : 0) +
5 (args_info.nfkc_given ? 1 : 0) != 1)
6 {
7 - error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
8 + error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be specified"));
9 usage (EXIT_FAILURE);
10 }
11
12 @@ -184,7 +184,7 @@ main (int argc, char *argv[])
13 if (!args_info.quiet_given
14 && args_info.inputs_num == 0
15 && isatty (fileno (stdin)))
16 - fprintf (stderr, _("Type each input string on a line by itself, "
17 + fprintf (stderr, "%s", _("Type each input string on a line by itself, "
18 "terminated by a newline character.\n"));
19
20 do
21 @@ -199,7 +199,7 @@ main (int argc, char *argv[])
22 if (feof (stdin))
23 break;
24
25 - error (EXIT_FAILURE, errno, _("input error"));
26 + error (EXIT_FAILURE, errno, "%s", _("input error"));
27 }
28
29 if (readbuf[strlen (readbuf) - 1] == '\n')
30 @@ -216,7 +216,7 @@ main (int argc, char *argv[])
31 if (!q)
32 {
33 free (p);
34 - error (EXIT_FAILURE, 0,
35 + error (EXIT_FAILURE, 0, "%s",
36 _("could not convert from UTF-8 to UCS-4"));
37 }
38
39 @@ -241,7 +241,7 @@ main (int argc, char *argv[])
40 if (!q)
41 {
42 free (r);
43 - error (EXIT_FAILURE, 0,
44 + error (EXIT_FAILURE, 0, "%s",
45 _("could not convert from UTF-8 to UCS-4"));
46 }
47
48 @@ -277,7 +277,7 @@ main (int argc, char *argv[])
49 q = stringprep_utf8_to_ucs4 (p, -1, &len);
50 free (p);
51 if (!q)
52 - error (EXIT_FAILURE, 0,
53 + error (EXIT_FAILURE, 0, "%s",
54 _("could not convert from UTF-8 to UCS-4"));
55
56 if (args_info.debug_given)
57 @@ -336,7 +336,7 @@ main (int argc, char *argv[])
58 r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
59 free (q);
60 if (!r)
61 - error (EXIT_FAILURE, 0,
62 + error (EXIT_FAILURE, 0, "%s",
63 _("could not convert from UCS-4 to UTF-8"));
64
65 p = stringprep_utf8_to_locale (r);
66 @@ -360,7 +360,7 @@ main (int argc, char *argv[])
67 q = stringprep_utf8_to_ucs4 (p, -1, NULL);
68 free (p);
69 if (!q)
70 - error (EXIT_FAILURE, 0,
71 + error (EXIT_FAILURE, 0, "%s",
72 _("could not convert from UCS-4 to UTF-8"));
73
74 if (args_info.debug_given)
75 @@ -438,7 +438,7 @@ main (int argc, char *argv[])
76 if (!q)
77 {
78 free (p);
79 - error (EXIT_FAILURE, 0,
80 + error (EXIT_FAILURE, 0, "%s",
81 _("could not convert from UCS-4 to UTF-8"));
82 }
83
84 @@ -494,7 +494,7 @@ main (int argc, char *argv[])
85 r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
86 free (q);
87 if (!r)
88 - error (EXIT_FAILURE, 0,
89 + error (EXIT_FAILURE, 0, "%s",
90 _("could not convert from UTF-8 to UCS-4"));
91
92 p = stringprep_utf8_to_locale (r);
93 @@ -523,7 +523,7 @@ main (int argc, char *argv[])
94 if (!q)
95 {
96 free (p);
97 - error (EXIT_FAILURE, 0,
98 + error (EXIT_FAILURE, 0, "%s",
99 _("could not convert from UTF-8 to UCS-4"));
100 }
101
102 @@ -537,7 +537,7 @@ main (int argc, char *argv[])
103 r = stringprep_utf8_nfkc_normalize (p, -1);
104 free (p);
105 if (!r)
106 - error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
107 + error (EXIT_FAILURE, 0, "%s", _("could not do NFKC normalization"));
108
109 if (args_info.debug_given)
110 {
111 @@ -547,7 +547,7 @@ main (int argc, char *argv[])
112 if (!q)
113 {
114 free (r);
115 - error (EXIT_FAILURE, 0,
116 + error (EXIT_FAILURE, 0, "%s",
117 _("could not convert from UTF-8 to UCS-4"));
118 }
119