Permalink
Browse files

Fix int overflow problem

  • Loading branch information...
1 parent 496ea1c commit 64b494e2833555e173db8c6a1a8b2f0fb58cf0a7 @edsrzf committed Jun 26, 2012
Showing with 6 additions and 6 deletions.
  1. +4 −4 ioctl.go
  2. +1 −1 termios_bsd.go
  3. +1 −1 termios_linux.go
View
@@ -5,12 +5,12 @@ import (
"unsafe"
)
-func winIoctl(fd int, cmd int, win *winsize) {
- _, _, _ = syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(win)))
+func winIoctl(fd int, cmd uintptr, win *winsize) {
+ _, _, _ = syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), cmd, uintptr(unsafe.Pointer(win)))
return
}
-func ttyIoctl(fd int, cmd int, term *termios) {
- _, _, _ = syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(term)))
+func ttyIoctl(fd int, cmd uintptr, term *termios) {
+ _, _, _ = syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), cmd, uintptr(unsafe.Pointer(term)))
return
}
View
@@ -11,7 +11,7 @@ func tcgetattr(fd int, t *termios) {
}
func tcsetattr(fd, op int, t *termios) {
- var cmd int
+ var cmd uintptr
switch op {
case TCSANOW:
cmd = syscall.TIOCSETA
View
@@ -9,7 +9,7 @@ func tcgetattr(fd int, t *termios) {
}
func tcsetattr(fd, op int, t *termios) {
- var cmd int
+ var cmd uintptr
switch op {
case TCSANOW:
cmd = syscall.TCSETS

0 comments on commit 64b494e

Please sign in to comment.