3db237ff65edd8bfc52f4b22088feb2acbc78bd0
mspeir
  Tue Nov 24 11:32:18 2015 -0800
Correcting spelling mistakes in usage and error messages, refs #14062

diff --git src/utils/countChars/countChars.c src/utils/countChars/countChars.c
index 578549a..1aa1c09 100644
--- src/utils/countChars/countChars.c
+++ src/utils/countChars/countChars.c
@@ -1,84 +1,84 @@
 /* countChars - Count the number of occurences of a particular char. */
 
 /* Copyright (C) 2011 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 #include "common.h"
 
 
 void usage()
 /* Explain usage and exit. */
 {
 errAbort(
-  "countChars - Count the number of occurences of a particular char\n"
+  "countChars - Count the number of occurrences of a particular char\n"
   "usage:\n"
   "   countChars char file(s)\n"
   "Char can either be a two digit hexadecimal value or\n"
   "a single letter literal character");
 }
 
 int unhex(char *s)
 /* Return hex val of s. */
 {
 int acc = 0;
 char c;
 
 tolowers(s);
 while ((c = *s++) != 0)
     {
     acc <<= 4;
     if (c >= '0' && c <= '9')
        acc += c - '0';
     else if (c >= 'a' && c <= 'f')
        acc += c + 10 - 'a';
     else
        errAbort("Expecting hexadecimal character got %s", s);
     }
 return acc;
 }
 
 
 int countCharsInFile(char c, char *fileName)
 /* Count up characters in file matching c. */
 {
 FILE *f = mustOpen(fileName, "r");
 int i;
 int count = 0;
 
 while ((i = fgetc(f)) >= 0)
     {
     if (i == c)
         ++count;
     }
 fclose(f);
 return count;
 }
 
 void doIt(char *ch, int fileCount, char *fileNames[])
 /* doIt - Count the number of occurences of a particular char. */
 {
 char c;
 int i;
 char *fileName;
 
 if (strlen(ch) > 1)
    c = unhex(ch);
 else
    c = ch[0];
 for (i=0; i<fileCount; ++i)
     {
     int count;
     fileName = fileNames[i];
     count = countCharsInFile(c, fileName);
     if (count > 0)
        printf("%s %d\n", fileName, count);
     }
 }
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 if (argc < 3)
     usage();
 doIt(argv[1], argc-2, argv+2);
 return 0;
 }