diff options
author | 2022-06-27 12:21:37 +0200 | |
---|---|---|
committer | 2022-06-27 12:21:37 +0200 | |
commit | 0f424f4f1d40cde274216a9eeed2f508e8f198f2 (patch) | |
tree | a5b81fbc3c39a37285d70ff93c11c8524fdd81da | |
parent | 26.3: Enable WebKit sandboxing (diff) | |
download | emacs-patches-0f424f4f1d40cde274216a9eeed2f508e8f198f2.tar.gz emacs-patches-0f424f4f1d40cde274216a9eeed2f508e8f198f2.tar.bz2 emacs-patches-0f424f4f1d40cde274216a9eeed2f508e8f198f2.zip |
18.59: Fix a warningemacs-18.59-patches-14
server.c:198:11: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-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); |