diff options
-rw-r--r-- | emacs/18.59/18_all_unused-result.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/emacs/18.59/18_all_unused-result.patch b/emacs/18.59/18_all_unused-result.patch new file mode 100644 index 0000000..a0870cd --- /dev/null +++ b/emacs/18.59/18_all_unused-result.patch @@ -0,0 +1,27 @@ +Fix a warning: +server.c:198:11: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] + +--- emacs-18.59/etc/ChangeLog ++++ emacs-18.59/etc/ChangeLog +@@ -1,3 +1,7 @@ ++2022-06-27 Ulrich Müller <ulm@gentoo.org> ++ ++ * server.c (main): Check scanf return value. ++ + 2020-08-29 Ulrich Mueller <ulm@gentoo.org> + + * movemail.c (pfatal_with_name, pfatal_and_delete, get_errmsg): + +--- emacs-18.59/etc/server.c ++++ emacs-18.59/etc/server.c +@@ -195,8 +195,8 @@ + { + /* Read command codeword and fd */ + clearerr (stdin); +- scanf ("%s %d%*c", code, &infd); +- if (ferror (stdin) || feof (stdin)) ++ if (scanf ("%s %d%*c", code, &infd) < 2 ++ || ferror (stdin) || feof (stdin)) + { + fprintf (stderr, "server: error reading from standard input\n"); + exit (1); |