diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2008-05-20 00:30:31 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2008-05-20 00:30:31 +0000 |
commit | 5de43ed25a6e014029dfe9f5f2735c65d11c9d35 (patch) | |
tree | 97df85cf77c0323a67601b6477789a3de5ee30ec /bin | |
parent | 136f0b9e976459fd2aeb36314292c906526b1e80 (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.c | 4 |
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 { |