diff options
author | Vadim Zborovskii <vadim_z@triniti.ru> | 2012-07-13 20:58:38 +0400 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2012-09-24 19:18:02 +1000 |
commit | 45e938f72dad52f897d6e89fb41470829e596238 (patch) | |
tree | dd74d5ac83b729d859abb8570841618887ab6b93 /binary.tcl | |
parent | 76a9f361d5db21434ee6cdeb44d945f3ad21d2bf (diff) | |
download | jimtcl-45e938f72dad52f897d6e89fb41470829e596238.zip jimtcl-45e938f72dad52f897d6e89fb41470829e596238.tar.gz jimtcl-45e938f72dad52f897d6e89fb41470829e596238.tar.bz2 |
Fix binary scan for too-few bytes.
According to the Tcl manual, in this case "binary scan returns immediately
with the number of variables that were set".
(Tests added by Steve Bennett)
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'binary.tcl')
-rw-r--r-- | binary.tcl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -125,7 +125,7 @@ proc "binary scan" {value formatString {args varName}} { set n 1 } if {$n > $rembytes} { - continue + break } set var [binary.nextarg varName] @@ -148,7 +148,7 @@ proc "binary scan" {value formatString {args varName}} { } } if {$n * $size > $rembytes * 8} { - continue + break } if {$type ne "int"} { |