freq: fix crash with utf > 0xffff (thanks Andrey Mirtchovski)

R=rsc
https://codereview.appspot.com/7029054
This commit is contained in:
David du Colombier 2013-01-04 20:06:08 +01:00
parent 0798d6b741
commit 23efb34d47

View file

@ -2,7 +2,7 @@
#include <libc.h> #include <libc.h>
#include <bio.h> #include <bio.h>
long count[1<<16]; uvlong count[Runemax+1];
Biobuf bout; Biobuf bout;
void freq(int, char*); void freq(int, char*);
@ -105,7 +105,7 @@ freq(int f, char *s)
else else
Bprint(&bout, "%C ", (int)i); Bprint(&bout, "%C ", (int)i);
} }
Bprint(&bout, "%8ld\n", count[i]); Bprint(&bout, "%8llud\n", count[i]);
} }
Bflush(&bout); Bflush(&bout);
} }