plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 23efb34d47df2cb993547995a532a6bf7333f08b
parent 0798d6b7417c2c0fbdff759fab6a91c1030044f4
Author: David du Colombier <0intro@gmail.com>
Date:   Fri,  4 Jan 2013 20:06:08 +0100

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

R=rsc
https://codereview.appspot.com/7029054

Diffstat:
Msrc/cmd/freq.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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); }