changed to unsigned integers

This commit is contained in:
obscuren
2014-12-10 11:27:10 +01:00
parent 4f1ef89cb2
commit 186948da22
3 changed files with 32 additions and 20 deletions

View File

@ -111,10 +111,10 @@ func NewMemory() *Memory {
return &Memory{nil}
}
func (m *Memory) Set(offset, size int64, value []byte) {
func (m *Memory) Set(offset, size uint64, value []byte) {
if len(value) > 0 {
totSize := offset + size
lenSize := int64(len(m.store) - 1)
lenSize := uint64(len(m.store) - 1)
if totSize > lenSize {
// Calculate the diff between the sizes
diff := totSize - lenSize