Changeset 20358
- Timestamp:
- Oct 24, 2008, 1:38:30 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libohana/src/config.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libohana/src/config.c
r16466 r20358 138 138 /* open file */ 139 139 f = fopen (filename, "r"); 140 if (f == NULL) {141 return ((char *) NULL);142 }140 // if (f == NULL) { 141 // return ((char *) NULL); 142 // } 143 143 144 144 /* allocate tmp space, 2 extra bytes for a final return and EOL */ … … 148 148 149 149 /* load data from file */ 150 done = FALSE; 151 while ((nbytes = fread (&ibuffer[Nbytes], sizeof(char), D_NBYTES, f)) == D_NBYTES) { 150 if (f) { 151 done = FALSE; 152 while ((nbytes = fread (&ibuffer[Nbytes], sizeof(char), D_NBYTES, f)) == D_NBYTES) { 153 Nbytes += nbytes; 154 NBYTES += D_NBYTES; 155 REALLOCATE (ibuffer, char, NBYTES + 2); 156 } 152 157 Nbytes += nbytes; 153 NBYTES += D_NBYTES; 154 REALLOCATE (ibuffer, char, NBYTES + 2); 155 } 156 Nbytes += nbytes; 157 fclose (f); 158 fclose (f); 159 } 158 160 159 161 /* add final return & EOL if non-existent */
Note:
See TracChangeset
for help on using the changeset viewer.
