tobias / vertx-swift-eventbus

Lib for using the Vert.x TCP EventBus bridge from Swift
Apache License 2.0
5 stars 2 forks source link

Util.intToBytes crashes #10

Open nfranke opened 6 years ago

nfranke commented 6 years ago

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:

            bytes.append(UInt8(0xff & (value >> Int32(x * 8))))
tobias commented 6 years ago

Hi @nfranke! I don't use this library, but I'm glad that someone does :) I'd be happy to take a PR to fix this (and #9).

tobias commented 6 years ago

Also see #11.

nfranke commented 6 years ago

I have created a pull request #12 for this and #9

Not sure how committed I'll be to this project just yet. I may be interested in maintaining it, all depends on whether it continues to work out for my project.