From c1ed2bab0689deba77eaf0db86ff3f54c9a3854a Mon Sep 17 00:00:00 2001 From: Ivy Foster Date: Wed, 21 Mar 2018 12:26:06 -0500 Subject: [PATCH] src/common/quetzal.c: Do not implicitly fall through in case statement --- src/common/quetzal.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common/quetzal.c b/src/common/quetzal.c index 3ef73e2..e687075 100644 --- a/src/common/quetzal.c +++ b/src/common/quetzal.c @@ -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. */ -- 2.34.1