X-Git-Url: http://gitweb.hachti.de/?a=blobdiff_plain;f=pc-tools%2Fldc%2Fcharcount.c;fp=pc-tools%2Fldc%2Fcharcount.c;h=525edcfdc9540b7ae60db3f9eb3688377ad2325b;hb=437b3ba835f66625031f4711cd0a963be67ccf5a;hp=0000000000000000000000000000000000000000;hpb=008a15c07914ebf7f69e6243c4d2754c8f959a7f;p=h316.git diff --git a/pc-tools/ldc/charcount.c b/pc-tools/ldc/charcount.c new file mode 100644 index 0000000..525edcf --- /dev/null +++ b/pc-tools/ldc/charcount.c @@ -0,0 +1,19 @@ +#include + +main () +{ + unsigned char buf; + int stat[256]; + int c; + for (c = 0; c < 256; c++) + stat[c] = 0; + int ret; + do { + ret = read (0, &buf, 1); + stat[buf]++; + } + while (ret); + for (c = 0; c < 256; c++) + printf ("%03i:%04i\n", c, stat[c]); + +}