+ if (ctx->size < 0 || ctx->length < 0) {
+ goto invalid;
+ }
+
I don't know C/C++ but I was under the impression nobody used goto? Is there anything good/bad about using it? + if (ctx->size < 0 || ctx->length < 0) {
+ goto invalid;
+ }
+
I don't know C/C++ but I was under the impression nobody used goto? Is there anything good/bad about using it?If you have a better way to express the control flow you should use it instead though.
If you are an expert programmer, you can use it in some parts where efficiency is important. Finite State Machine implementations are a common use.