Source: nn
Version: 6.7.3-14
Severity: normal
Tags: patch

Dear Maintainer,

>From 7affc9ce4fca374a256f8195eea7800033d20a96 Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Sat, 6 Mar 2021 03:19:19 +0000
>Subject: [PATCH] menu.c: Fix errors

  In case constructs:

  Use "break" as the last command in a case.

  Use /* FALLTHROUGH */, not a "goto default;" which does not function.

Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 menu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/menu.c b/menu.c
index 6ddb96f..90462c4 100644
--- a/menu.c
+++ b/menu.c
@@ -1485,10 +1485,8 @@ new_state:
 
                case AC_REENTER_GROUP:
                    menu_return(ME_REENTER_GROUP);
- /* Previous command returns or "goto", but the compiler can't know that,
-so "break" is used to tell that */
-                   break; /* avoid a "fallthrough" warning */
            }
+           break; /* avoid a warning */
            /* XXX: bug? fall */
 
        case K_QUIT:
@@ -2412,8 +2410,9 @@ do_auto_read:
                    firsta = nexta;
                goto redraw;
            }
-           goto default; /* Uncertain code, avoid a warning */
+           /* FALLTHROUGH */ /* Avoids a warning */
            /* XXX: fall? */
+
        case MC_NEXTGROUP:
            menu_cmd = ME_NEXT;
            break;
-- 
2.30.1



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.9-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- debconf information excluded

-- 
Bjarni I. Gislason

Reply via email to