freq: fix crash with utf > 0xffff (thanks Andrey Mirtchovski)
R=rsc
https://codereview.appspot.com/7029054
diff --git a/src/cmd/freq.c b/src/cmd/freq.c
index 19b3fa9..daba277 100644
--- a/src/cmd/freq.c
+++ b/src/cmd/freq.c
@@ -2,7 +2,7 @@
#include <libc.h>
#include <bio.h>
-long count[1<<16];
+uvlong count[Runemax+1];
Biobuf bout;
void freq(int, char*);
@@ -105,7 +105,7 @@
else
Bprint(&bout, "%C ", (int)i);
}
- Bprint(&bout, "%8ld\n", count[i]);
+ Bprint(&bout, "%8llud\n", count[i]);
}
Bflush(&bout);
}