diff --git a/bfg.c b/bfg.c index d8a09a6..5b7df89 100644 --- a/bfg.c +++ b/bfg.c @@ -226,7 +226,7 @@ char *bf_next() { pos--; } - if (pos < 0) { + if (pos < 0 || pos >= bf_options.current) { bf_options.current++; memset((char *)bf_options.state, 0, sizeof(bf_options.state)); }