aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2013-01-04 20:06:08 +0100
committerDavid du Colombier <0intro@gmail.com>2013-01-04 20:06:08 +0100
commit23efb34d47df2cb993547995a532a6bf7333f08b (patch)
tree4822802ba84728eabd6e28faeb58dfaa679610de
parent0798d6b7417c2c0fbdff759fab6a91c1030044f4 (diff)
downloadplan9port-23efb34d47df2cb993547995a532a6bf7333f08b.tar.gz
plan9port-23efb34d47df2cb993547995a532a6bf7333f08b.tar.bz2
plan9port-23efb34d47df2cb993547995a532a6bf7333f08b.zip
freq: fix crash with utf > 0xffff (thanks Andrey Mirtchovski)
R=rsc https://codereview.appspot.com/7029054
-rw-r--r--src/cmd/freq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/freq.c b/src/cmd/freq.c
index 19b3fa9a..daba277f 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 @@ freq(int f, char *s)
else
Bprint(&bout, "%C ", (int)i);
}
- Bprint(&bout, "%8ld\n", count[i]);
+ Bprint(&bout, "%8llud\n", count[i]);
}
Bflush(&bout);
}