diff options
author | rsc <devnull@localhost> | 2006-02-14 19:42:58 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-02-14 19:42:58 +0000 |
commit | 54357361fbc3032b36688bb4c1d4ced1f14f08f6 (patch) | |
tree | 25c7ff73112fea0165688ae1744601a1ac37782a /src/cmd/mpm | |
parent | a38a183626848f897085b4d2e54dad6d39146948 (diff) | |
download | plan9port-54357361fbc3032b36688bb4c1d4ced1f14f08f6.tar.gz plan9port-54357361fbc3032b36688bb4c1d4ced1f14f08f6.tar.bz2 plan9port-54357361fbc3032b36688bb4c1d4ced1f14f08f6.zip |
better utf
Diffstat (limited to 'src/cmd/mpm')
-rw-r--r-- | src/cmd/mpm/slug.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/mpm/slug.cc b/src/cmd/mpm/slug.cc index 14378b90..b4ae0ff8 100644 --- a/src/cmd/mpm/slug.cc +++ b/src/cmd/mpm/slug.cc @@ -1,7 +1,7 @@ #include "misc.h" #include "slug.h" -//#include <libc.h> #include <math.h> +#include <utf.h> static char *bufptr(int); @@ -156,7 +156,7 @@ static char *getutf(FILE *fp) // get 1 utf-encoded char (might be multiple bytes for (*p = 0; (*p++ = getc(fp)) != EOF; ) { *p = 0; - if (mblen(buf, sizeof buf) > 0) // found a valid character + if (fullrune(buf, p-buf)) // found a valid character break; } return buf; |