summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2008-05-20 00:30:31 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2008-05-20 00:30:31 +0000
commit5de43ed25a6e014029dfe9f5f2735c65d11c9d35 (patch)
tree97df85cf77c0323a67601b6477789a3de5ee30ec /bin
parent136f0b9e976459fd2aeb36314292c906526b1e80 (diff)
cast pointer arithmetic to unsigned so we can behave correctly on
underflows. fixes fc -l 1 in my box where line is 1667511151. krw@ ok.
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/history.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c
index d7f38e152c1..68475bef654 100644
--- a/bin/ksh/history.c
+++ b/bin/ksh/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.35 2006/05/29 18:22:24 otto Exp $ */
+/* $OpenBSD: history.c,v 1.36 2008/05/20 00:30:30 fgsch Exp $ */
/*
* command history
@@ -352,7 +352,7 @@ hist_get(const char *str, int approx, int allow_cur)
if (getn(str, &n)) {
hp = histptr + (n < 0 ? n : (n - hist_source->line));
- if (hp < history) {
+ if ((long)hp < (long)history) {
if (approx)
hp = hist_get_oldest();
else {