summaryrefslogtreecommitdiff
path: root/doc/progs/cat_rot13.go
diff options
context:
space:
mode:
Diffstat (limited to 'doc/progs/cat_rot13.go')
-rw-r--r--doc/progs/cat_rot13.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/doc/progs/cat_rot13.go b/doc/progs/cat_rot13.go
index d5050155d..a8c570add 100644
--- a/doc/progs/cat_rot13.go
+++ b/doc/progs/cat_rot13.go
@@ -11,15 +11,14 @@ import (
var rot13_flag = Flag.Bool("rot13", false, nil, "rot13 the input")
-func rot13(bb byte) byte {
- var b int = int(bb) /// BUG: until byte division is fixed
+func rot13(b byte) byte {
if 'a' <= b && b <= 'z' {
b = 'a' + ((b - 'a') + 13) % 26;
}
if 'A' <= b && b <= 'Z' {
b = 'A' + ((b - 'A') + 13) % 26
}
- return byte(b)
+ return b
}
type Reader interface {