Fix to stop a fall-through in a switch statement

Message ID 7d70b1ee-1be7-f80b-15b6-6d5806abbe31@fibranet.cat
State Accepted
Commit ab640f4cd5605b6675538b196641c46c36c75c64
Headers show
Series
  • Fix to stop a fall-through in a switch statement
Related show

Commit Message

Jordi Sanfeliu July 13, 2018, 10:15 a.m.
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().


Thanks.

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

Comments

Corinna Vinschen July 13, 2018, 11:35 a.m. | #1
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

Patch

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 ();
         }