1 Commits
Author SHA1 Message Date
Luxferre ec2c95ca07 Fixed v3 value scanning 2024-10-12 16:41:58 +03:00
+2 -4
View File
@@ -359,9 +359,7 @@ proc fullscanscheme {version} {
if {$size eq 1} {set fmt cu}
if {$size eq 2} {set fmt s}
if {$size eq 4} {set fmt i}
catch {
binary scan [string range $rawschemedata [expr {$offs + $size}]] $fmt wscval
}
binary scan [string range $rawschemedata $offs [expr {$offs + $size}]] $fmt wscval
if {([llength $valopt] > 1) && ([lindex $valopt 0] eq "spec")} {
set readfunc "[lindex $valopt 1]_read"
set wscval [$readfunc $wscval]
@@ -427,7 +425,7 @@ proc savescheme {fname} {
if {$diffbytes > 0} { # expand with nulls
set rawschemedata [string cat $rawschemedata [binary format x$diffbytes]]
} else { # truncate
set rawschemedata [string range $rawschemedata 0 [expr {$datasize - 1}]
set rawschemedata [string range $rawschemedata 0 [expr {$datasize - 1}]]
}
# write the version itself
set binval [binary format cu $wsc_data(version)]