Line 0
Link Here
|
|
|
1 |
--- libcob/fileio.c.orig Wed Jun 11 15:40:20 2003 |
2 |
+++ libcob/fileio.c Wed Aug 27 09:57:31 2003 |
3 |
@@ -202,13 +202,10 @@ |
4 |
else |
5 |
{ |
6 |
/* discard input until the next newline */ |
7 |
- int c = getc (f->file); |
8 |
- while (c != '\r' && c != '\n' && c != EOF) |
9 |
- c = getc (f->file); |
10 |
- if (c == '\r') |
11 |
- c = getc (f->file); |
12 |
- if (c != '\n' && c != EOF) |
13 |
- ungetc (c, f->file); |
14 |
+ char buff[BUFSIZ]; |
15 |
+ while (fgets (buff, BUFSIZ, f->file) !=NULL) |
16 |
+ if (strchr (buff, '\n') != NULL) |
17 |
+ break; |
18 |
} |
19 |
|
20 |
memcpy (f->record->data, buff, f->record->size); |