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 Mueller + + * 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);