aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/unicode.c
diff options
context:
space:
mode:
authorRuss Cox <russcox@gmail.com>2009-09-11 17:03:06 -0400
committerRuss Cox <russcox@gmail.com>2009-09-11 17:03:06 -0400
commit0cadb4301d18724e7513d7489cb5bebd262c82f1 (patch)
tree48209a4083885288eaa09178d4017769897107b3 /src/cmd/unicode.c
parent4dbf255619efac4f0a00e4216d6c999128910df2 (diff)
downloadplan9port-0cadb4301d18724e7513d7489cb5bebd262c82f1.tar.gz
plan9port-0cadb4301d18724e7513d7489cb5bebd262c82f1.tar.bz2
plan9port-0cadb4301d18724e7513d7489cb5bebd262c82f1.zip
convert to 4-byte UTF-8 and 32-bit Rune
http://codereview.appspot.com/116075
Diffstat (limited to 'src/cmd/unicode.c')
-rw-r--r--src/cmd/unicode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/unicode.c b/src/cmd/unicode.c
index a0447271..aec44b75 100644
--- a/src/cmd/unicode.c
+++ b/src/cmd/unicode.c
@@ -51,13 +51,13 @@ range(char *argv[])
return "bad range";
}
min = strtoul(q, &q, 16);
- if(min<0 || min>0xFFFF || *q!='-')
+ if(min<0 || min>Runemax || *q!='-')
goto err;
q++;
if(strchr(hex, *q) == 0)
goto err;
max = strtoul(q, &q, 16);
- if(max<0 || max>0xFFFF || max<min || *q!=0)
+ if(max<0 || max>Runemax || max<min || *q!=0)
goto err;
i = 0;
do{
@@ -111,7 +111,7 @@ chars(char *argv[])
return "bad char";
}
m = strtoul(q, &q, 16);
- if(m<0 || m>0xFFFF || *q!=0)
+ if(m<0 || m>Runemax || *q!=0)
goto err;
Bprint(&bout, "%C", m);
if(!text)