diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-12-31 21:09:46 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-12-31 21:09:46 +0100 |
commit | 6cadd03bbeace1c256ba875c2e6a877f924877cd (patch) | |
tree | 8079ea6f6ccdb1c2cbb2b7813f618837617cb33e /sys/src/cmd/ip | |
parent | 6d99096136278f06f6333f927da34105a8dfe0bf (diff) |
fix utf and rune handling in preparation for 32bit runes
Diffstat (limited to 'sys/src/cmd/ip')
-rw-r--r-- | sys/src/cmd/ip/ftpfs/proto.c | 2 | ||||
-rw-r--r-- | sys/src/cmd/ip/httpd/wikipost.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/cmd/ip/ftpfs/proto.c b/sys/src/cmd/ip/ftpfs/proto.c index 0e4737952..d96ac036f 100644 --- a/sys/src/cmd/ip/ftpfs/proto.c +++ b/sys/src/cmd/ip/ftpfs/proto.c @@ -1525,7 +1525,7 @@ fromlatin1(char *from) if(*p == 0) return nil; - to = malloc(3*strlen(from)+2); + to = malloc(UTFmax*strlen(from)+2); if(to == nil) return nil; for(p = to; *from; from++){ diff --git a/sys/src/cmd/ip/httpd/wikipost.c b/sys/src/cmd/ip/httpd/wikipost.c index 31fbedda1..6d9279c47 100644 --- a/sys/src/cmd/ip/httpd/wikipost.c +++ b/sys/src/cmd/ip/httpd/wikipost.c @@ -59,7 +59,7 @@ _urlunesc(char *s) t = v; while(*s){ /* in decoding error, assume latin1 */ - if((n=chartorune(&r, s)) == 1 && r == 0x80) + if((n=chartorune(&r, s)) == 1 && r == Runeerror) r = *s; s += n; t += runetochar(t, &r); |