Correct eof/error handling in read_roots(). merge_30_31_src5
authorZdeněk Salvet <salvet@ics.muni.cz>
Fri, 27 Apr 2007 08:23:40 +0000 (08:23 +0000)
committerZdeněk Salvet <salvet@ics.muni.cz>
Fri, 27 Apr 2007 08:23:40 +0000 (08:23 +0000)
org.glite.lb.server/src/bkserverd.c

index 0ee0389..f368669 100644 (file)
@@ -1383,9 +1383,8 @@ static int read_roots(const char *file)
                return 0;
        }
 
-       while (!feof(roots)) {
+       while (fgets(buf,sizeof buf,roots) != NULL) {
                char    *nl;
-               fgets(buf,sizeof buf,roots);
                nl = strchr(buf,'\n');
                if (nl) *nl = 0;