--- a/XBMReader.st Wed Sep 12 17:33:16 2001 +0200
+++ b/XBMReader.st Thu Sep 13 11:01:37 2001 +0200
@@ -229,18 +229,24 @@
].
[lineString notNil] whileTrue:[
- index := 1.
- [index ~~ 0] whileTrue:[
- index := lineString indexOf:$x startingAt:index.
- (index ~~ 0) ifTrue:[
- index := index + 1.
- hi := (lineString at:index) digitValue.
- index := index + 1.
- lo := (lineString at:index) digitValue.
- val := (hi bitShift:4) bitOr:lo.
- data at:dstIndex put:(reverseBits at:(val + 1)).
- dstIndex := dstIndex + 1
- ]
+ dstIndex <= data size ifTrue:[
+ index := 1.
+ [index ~~ 0] whileTrue:[
+ dstIndex <= data size ifTrue:[
+ index := lineString indexOf:$x startingAt:index.
+ (index ~~ 0) ifTrue:[
+ index := index + 1.
+ hi := (lineString at:index) digitValue.
+ index := index + 1.
+ lo := (lineString at:index) digitValue.
+ val := (hi bitShift:4) bitOr:lo.
+ data at:dstIndex put:(reverseBits at:(val + 1)).
+ dstIndex := dstIndex + 1
+ ]
+ ] ifFalse:[
+ index := 0. "/ break loop
+ ]
+ ].
].
lineString := aStream nextLine.
[lineString notNil and:[lineString isEmpty]] whileTrue:[
@@ -345,6 +351,6 @@
!XBMReader class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.42 2001-08-22 16:38:44 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.43 2001-09-13 09:01:37 cg Exp $'
! !
XBMReader initialize!