diff options
author | joerg <joerg@FreeBSD.org> | 1996-03-17 09:00:48 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-03-17 09:00:48 +0000 |
commit | e34654d22580a832d167c385344cf59912484a44 (patch) | |
tree | 704c716da0fdb3204f321b909613ed6bc4793bca /usr.bin/tr/str.c | |
parent | 0bb6d124027b858b64212108bf4a35c6909a53a1 (diff) | |
download | FreeBSD-src-e34654d22580a832d167c385344cf59912484a44.zip FreeBSD-src-e34654d22580a832d167c385344cf59912484a44.tar.gz |
Fix a couple of sign-extension bugs.
Submitted by: serg@bcs1.bcs.zaporizhzhe.ua (Sergey Shkonda)
Diffstat (limited to 'usr.bin/tr/str.c')
-rw-r--r-- | usr.bin/tr/str.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tr/str.c b/usr.bin/tr/str.c index 3d532cf..0c2b6ef 100644 --- a/usr.bin/tr/str.c +++ b/usr.bin/tr/str.c @@ -67,7 +67,7 @@ next(s) case INFINITE: return (1); case NORMAL: - switch (ch = *s->str) { + switch (ch = (u_char)*s->str) { case '\0': s->state = EOS; return (0); @@ -241,7 +241,7 @@ genrange(s) char *savestart; savestart = s->str; - stopval = *++s->str == '\\' ? backslash(s) : *s->str++; + stopval = *++s->str == '\\' ? backslash(s) : (u_char)*s->str++; if (stopval < (u_char)s->lastch) { s->str = savestart; return (0); |