]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoder.c
lpc: Improve robustness when decoding unexpected input data
[libsigrokdecode.git] / decoder.c
index 9c57b1c337652840417de01829fc0c5d75654636..d7395a679eb3d0bac8d9d91a2073cadd4490a1f9 100644 (file)
--- a/decoder.c
+++ b/decoder.c
@@ -594,6 +594,8 @@ static int check_method(PyObject *py_dec, const char *mod_name,
  * @param d The decoder to use. Must not be NULL.
  *
  * @return The API version of the decoder, or 0 upon errors.
+ *
+ * @private
  */
 SRD_PRIV long srd_decoder_apiver(const struct srd_decoder *d)
 {
@@ -684,8 +686,8 @@ SRD_API int srd_decoder_load(const char *module_name)
         * PDs of different API versions are incompatible and cannot work.
         */
        apiver = srd_decoder_apiver(d);
-       if (apiver != 2 && apiver != 3) {
-               srd_exception_catch("Only PD API version 2/3 is supported, "
+       if (apiver != 3) {
+               srd_exception_catch("Only PD API version 3 is supported, "
                        "decoder %s has version %ld", module_name, apiver);
                fail_txt = "API version mismatch";
                goto err_out;