public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] manual: Fix termios.c example. (Bug 31078)
Date: Mon, 20 Nov 2023 21:43:30 +0000 (GMT)	[thread overview]
Message-ID: <20231120214330.125113858D38@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3cbaacdfd2c11cb726011ef6464dce00c186a2bf

commit 3cbaacdfd2c11cb726011ef6464dce00c186a2bf
Author: Carlos O'Donell <carlos@redhat.com>
Date:   Mon Nov 20 13:15:34 2023 -0500

    manual: Fix termios.c example. (Bug 31078)
    
    Remove the unused 'char *name;' from the example.
    
    Use write instead of putchar to write input as it is read.
    
    Example tested on x86_64 by compiling and running the example.
    
    Tested by building the manual pdf and reviewing the results.
    
    Reviewed-by: Florian Weimer <fweimer@redhat.com>

Diff:
---
 manual/examples/termios.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/manual/examples/termios.c b/manual/examples/termios.c
index 751e57ad71..65bedad9cc 100644
--- a/manual/examples/termios.c
+++ b/manual/examples/termios.c
@@ -34,7 +34,6 @@ void
 set_input_mode (void)
 {
   struct termios tattr;
-  char *name;
 
   /* Make sure stdin is a terminal. */
   if (!isatty (STDIN_FILENO))
@@ -70,7 +69,7 @@ main (void)
       if (c == '\004')		/* @kbd{C-d} */
 	break;
       else
-	putchar (c);
+	write (STDOUT_FILENO, &c, 1);
     }
 
   return EXIT_SUCCESS;

                 reply	other threads:[~2023-11-20 21:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231120214330.125113858D38@sourceware.org \
    --to=carlos@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).