[Spice-devel] [spice-common 3/8] quic: Add missing break; in switch/case

Christophe Fergeau cfergeau at redhat.com
Mon Jan 6 03:22:09 PST 2014


Unhandled values call an error callback, and then fall through the default:
case, which will call again the error callback. This commit adds some
break; after these cases to avoid this.
---
 common/quic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/quic.c b/common/quic.c
index bcbf093..2cffde5 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -943,8 +943,10 @@ static void find_model_params(Encoder *encoder,
     case 2: /* obsolete */
     case 4: /* obsolete */
         encoder->usr->error(encoder->usr, "findmodelparams(): evol value obsolete!!!\n");
+        break;
     default:
         encoder->usr->error(encoder->usr, "findmodelparams(): evol out of range!!!\n");
+        break;
     }
 
     *nbuckets = 0;
-- 
1.8.4.2



More information about the Spice-devel mailing list