src/common/quetzal.c: Do not implicitly fall through in case statement
authorIvy Foster <iff@escondida.tk>
Wed, 21 Mar 2018 17:26:06 +0000 (12:26 -0500)
committerIvy Foster <iff@escondida.tk>
Wed, 21 Mar 2018 17:26:06 +0000 (12:26 -0500)
src/common/quetzal.c

index 3ef73e252734a61a76eb9b363953c154a346071d..e687075973d20bb088e2d4e25ab835f1759f541a 100644 (file)
@@ -376,7 +376,9 @@ zword restore_quetzal (FILE *svf, FILE *stf)
                        progress |= GOT_MEMORY; /* Only if succeeded. */
                    break;
            }
-               /* Fall right thru (to default) if already GOT_MEMORY */
+               /* Already GOT_MEMORY */
+               (void) fseek (svf, currlen, SEEK_CUR);  /* Skip chunk. */
+               break;
            /* `UMem' uncompressed memory chunk; load it. */
            case ID_UMem:
                if (!(progress & GOT_MEMORY))   /* Don't complain if two. */
@@ -391,10 +393,12 @@ zword restore_quetzal (FILE *svf, FILE *stf)
                        }
                    }
                    else
+                       /* actually handle the problem outside if statement by skipping chunk. */
                        print_string ("`UMem' chunk wrong size!\n");
-                   /* Fall into default action (skip chunk) on errors. */
                }
-               /* Fall thru (to default) if already GOT_MEMORY */
+               /* Already GOT_MEMORY */
+               (void) fseek (svf, currlen, SEEK_CUR);  /* Skip chunk. */
+               break;
            /* Unrecognised chunk type; skip it. */
            default:
                (void) fseek (svf, currlen, SEEK_CUR);  /* Skip chunk. */