Fix usage of gmx_eof
authorRoland Schulz <roland@utk.edu>
Wed, 30 Apr 2014 07:37:36 +0000 (03:37 -0400)
committerRoland Schulz <roland@utk.edu>
Wed, 30 Apr 2014 08:52:27 +0000 (04:52 -0400)
gmx_eof has different behavior from gmx_eof and feof
should be used here.

Change-Id: I877c15d0edde64fe06ae2eedbda980f117509449

src/gromacs/utility/cstringutil.c

index 71c22d38387a854a419ff5f019a4f60f09821ac2..29266fd276ba0dedabac479bd3a5e0c5d55ecd99 100644 (file)
@@ -103,7 +103,7 @@ char *fgets2(char *line, int n, FILE *stream)
          * or because of n being too small.
          * Since both cases occur very infrequently, we can check for EOF.
          */
-        if (!gmx_eof(stream))
+        if (!feof(stream))
         {
             gmx_fatal(FARGS, "An input file contains a line longer than %d characters, while the buffer passed to fgets2 has size %d. The line starts with: '%20.20s'", n, n, line);
         }