altos/scheme: Avoid crashing with non-list in length
[fw/altos] / src / scheme / ao_scheme_cons.c
index 03dad956d6561f59e31f4e79bc3004def0c3e2a9..21ee10cc668abb405ea52db60204053e5a6f01f1 100644 (file)
@@ -195,7 +195,7 @@ ao_scheme_cons_length(struct ao_scheme_cons *cons)
        int     len = 0;
        while (cons) {
                len++;
-               cons = ao_scheme_poly_cons(cons->cdr);
+               cons = ao_scheme_cons_cdr(cons);
        }
        return len;
 }