core: length: Check parameter.

* src/mes.c (length): Check parameter.
This commit is contained in:
Jan Nieuwenhuizen 2018-04-30 19:31:00 +02:00
parent 98417537a2
commit ec85612ac4
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -520,6 +520,8 @@ length__ (SCM x) ///((internal))
SCM
length (SCM x)
{
if (x != cell_nil && TYPE (x) != TPAIR)
error (cell_symbol_not_a_pair, x);
return MAKE_NUMBER (length__ (x));
}