aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-26 13:37:51 +0100
committerPřemysl Eric Janouch <p@janouch.name>2020-10-26 13:37:51 +0100
commit279d010e0fcddbbd0f8ebb456cc1fa253c7cd994 (patch)
tree453865a67bbecd2e716af4705a17d086bceb60e1
parent8c4e867760eb20e3cdf997a301c8f8672c01e380 (diff)
downloadtermo-279d010e0fcddbbd0f8ebb456cc1fa253c7cd994.tar.gz
termo-279d010e0fcddbbd0f8ebb456cc1fa253c7cd994.tar.xz
termo-279d010e0fcddbbd0f8ebb456cc1fa253c7cd994.zip
Fix a spurious "implicit fallthrough" warning
-rw-r--r--termo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/termo.c b/termo.c
index e78d1b8..d1002ff 100644
--- a/termo.c
+++ b/termo.c
@@ -906,21 +906,20 @@ peekkey (termo_t *tk, termo_key_t *key, int flags, size_t *nbytep)
switch (ret)
{
+ size_t halfsize;
case TERMO_RES_KEY:
- {
#ifdef DEBUG
print_key (tk, key); fprintf (stderr, "\n");
#endif
// Slide the data down to stop it running away
- size_t halfsize = tk->buffsize / 2;
+ halfsize = tk->buffsize / 2;
if (tk->buffstart > halfsize)
{
memcpy (tk->buffer, tk->buffer + halfsize, halfsize);
tk->buffstart -= halfsize;
}
- // Fallthrough
- }
+ // Fall-through
case TERMO_RES_EOF:
case TERMO_RES_ERROR:
return ret;