public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix to stop a fall-through in a switch statement
@ 2018-07-13 11:28 Jordi Sanfeliu
  2018-07-13 11:37 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Jordi Sanfeliu @ 2018-07-13 11:28 UTC (permalink / raw)
  To: newlib

Hello,

The following fixes a fall-through that prevented from reading the next 
entry in the UTMP file and terminated the program with an abort().

diff --git a/newlib/libc/unix/getut.c b/newlib/libc/unix/getut.c
index c3a9b62..89ed739 100644
--- a/newlib/libc/unix/getut.c
+++ b/newlib/libc/unix/getut.c
@@ -65,6 +65,7 @@ getutid (struct utmp *id)
         case DEAD_PROCESS:
           if (id->ut_id == utmp_data.ut_id)
             return &utmp_data;
+         break;
         default:
           abort ();
         }

Thanks.

-- 
Jordi Sanfeliu
FIBRANET Network Services Provider
https://www.fibranet.cat

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix to stop a fall-through in a switch statement
  2018-07-13 11:28 [PATCH] Fix to stop a fall-through in a switch statement Jordi Sanfeliu
@ 2018-07-13 11:37 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2018-07-13 11:37 UTC (permalink / raw)
  To: Jordi Sanfeliu; +Cc: newlib

[-- Attachment #1: Type: text/plain, Size: 811 bytes --]

On Jul 13 12:15, Jordi Sanfeliu wrote:
> Hello,
> 
> The following fixes a fall-through that prevented from reading the next
> entry in the UTMP file and terminated the program with an abort().
> 
> diff --git a/newlib/libc/unix/getut.c b/newlib/libc/unix/getut.c
> index c3a9b62..89ed739 100644
> --- a/newlib/libc/unix/getut.c
> +++ b/newlib/libc/unix/getut.c
> @@ -65,6 +65,7 @@ getutid (struct utmp *id)
>         case DEAD_PROCESS:
>           if (id->ut_id == utmp_data.ut_id)
>             return &utmp_data;
> +         break;
>         default:
>           abort ();
>         }

Your patch has whitespace problems (TABs -> space).  Just a hint
for next time, I applied and pushed it with changes for now.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-13 11:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 11:28 [PATCH] Fix to stop a fall-through in a switch statement Jordi Sanfeliu
2018-07-13 11:37 ` Corinna Vinschen

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).