diff --git a/src/opcodes.c b/src/opcodes.c index 2415f942d7c4abc1e8eda9aab5a8d41c7a8d7c7e..09d63e1e8144f78b479b86f1a6d49cd397c8bb73 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -25,7 +25,7 @@ #include "security.h" #include "bignum.h" -RCSID("$Id: opcodes.c,v 1.64 1999/11/04 20:04:05 hubbe Exp $"); +RCSID("$Id: opcodes.c,v 1.65 1999/11/04 20:25:18 hubbe Exp $"); void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) { @@ -1040,7 +1040,7 @@ static INT32 PIKE_CONCAT4(very_low_sscanf_,INPUT_SHIFT,_,MATCH_SHIFT)( \ long tmp; \ for(e=cnt+1,tmp=1;tmp;e++) \ { \ - if(!match[e]) \ + if(e>=match_len) \ { \ error("Missing %%} in format string.\n"); \ break; /* UNREACHED */ \ diff --git a/src/testsuite.in b/src/testsuite.in index f30df2d8a5a43806c50e64592874790d98234f99..1c160308577195444faae49372519c22bfbf2bbf 100644 --- a/src/testsuite.in +++ b/src/testsuite.in @@ -1,4 +1,4 @@ -test_true([["$Id: testsuite.in,v 1.222 1999/11/04 20:04:07 hubbe Exp $"]]) +test_true([["$Id: testsuite.in,v 1.223 1999/11/04 20:25:20 hubbe Exp $"]]) cond([[all_constants()->_verify_internals]], [[ @@ -1774,6 +1774,9 @@ test_equal([[array_sscanf("foo\1000\1001\1111\1110\2000","%s%[\1000-\1111]%s")]] test_equal([[array_sscanf("\2000\1000\1111\1001\1110foo","%s%[\1000-\1111]%s")]], [[ ({ "\2000", "\1000\1111\1001\1110", "foo"}) ]]) + +test_equal([[ array_sscanf("02 00 DC 00 0B","%{%x%*[\0-/:-@]%}")[0] ]], + [[ ({ ({2}), ({0}), ({220}),({0}), ({11}) }) ]]) // Basics