Browse Source

Merge pull request #4 from temoto/fix-32bit-build

Fix 32bit build. len() in 32-bit environment returns a 32-bit integer which overflows MaxUint32. Need explicit conversion to int64.
ugorji 12 years ago
parent
commit
d732a23ad3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      codec/binc.go

+ 1 - 1
codec/binc.go

@@ -276,7 +276,7 @@ func (e *bincEncoder) encodeSymbol(v string) {
 			// lenprec = 0
 		case l <= math.MaxUint16:
 			lenprec = 1
-		case l <= math.MaxUint32:
+		case int64(l) <= math.MaxUint32:
 			lenprec = 2
 		default:
 			lenprec = 3