Commit 7ef7a1b3 authored by Geoff Thorpe's avatar Geoff Thorpe
Browse files

Avoid undefined results when the parameter is out of range.

parent f36f4694
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ int sk_num(const STACK *st)

char *sk_value(const STACK *st, int i)
{
	if(st == NULL) return NULL;
	if(!st || (i < 0) || (i >= st->num)) return NULL;
	return st->data[i];
}