Skip to content

Commit

Permalink
Fix for original issue tobias#10:
Browse files Browse the repository at this point in the history
	If the value is over 255 then intToBytes will crash because the UInt8() cast will cause a runtime exception. I suggest changing that line to this:
  • Loading branch information
Norman Franke authored and Norman Franke committed Apr 20, 2018
1 parent 0dc12b8 commit 5b3d587
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Util {

var x = 3
while x >= 0 {
bytes.append(UInt8(value >> Int32(x * 8)))
bytes.append(UInt8(0xff & (value >> Int32(x * 8))))
x -= 1
}

Expand Down

0 comments on commit 5b3d587

Please sign in to comment.