summaryrefslogtreecommitdiff
path: root/sample/rcs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/rcs.rb')
-rw-r--r--sample/rcs.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/sample/rcs.rb b/sample/rcs.rb
index b147429..6d7f10c 100644
--- a/sample/rcs.rb
+++ b/sample/rcs.rb
@@ -14,7 +14,7 @@ while gets()
while xr < hdw
x = xr * (1 + y) - y * w / 2
i = (x / (1 + h) + sw /2)
- c = if (0 < i < $_.length); $_[i, 1].to_i else 0 end
+ c = if (1 < i && i < $_.length); $_[i, 1].to_i else 0 end
y = h - d * c
xl = xr - w * y / (1 + y);
if xl < -hdw || xl >= hdw || xl <= maxxl