From 0f424f4f1d40cde274216a9eeed2f508e8f198f2 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Mon, 27 Jun 2022 12:21:37 +0200 Subject: 18.59: Fix a warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit server.c:198:11: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] Signed-off-by: Ulrich Müller --- emacs/18.59/18_all_unused-result.patch | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 emacs/18.59/18_all_unused-result.patch 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 ++ ++ * server.c (main): Check scanf return value. ++ + 2020-08-29 Ulrich Mueller + + * 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); -- cgit v1.2.3-65-gdbad