]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/samples/ugrep/ugrep.cpp
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / samples / ugrep / ugrep.cpp
index 0eeba6802aaafad203c17602e8753a4fdae0bbac..4f920137b7a7139625bc7e4e8932406d3a68c331 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
 *
-*   Copyright (C) 2002, International Business Machines
+*   Copyright (C) 2002-2010, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ***************************************************************************
@@ -287,6 +287,7 @@ void readFile(const char *name) {
     int t = fread(charBuf, 1, rawFileLen, file);
     if (t != rawFileLen)  {
         fprintf(stderr, "Error reading file \"%s\"\n", fileName);
+        fclose(file);
         return;
     }
     charBuf[rawFileLen]=0;