File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 4
4
#include <stdlib.h>
5
5
#include <string.h>
6
6
#include <errno.h>
7
+ #include <ctype.h>
7
8
8
9
#include "strutil.h"
9
10
@@ -32,7 +33,7 @@ int readlines(char *filename, char **textlines) {
32
33
as char *text[MAX] */
33
34
34
35
FILE * finp ;
35
- char * thisline ;
36
+ char * thisline ;
36
37
char * text , * c ;
37
38
long file_length , index , i , ilen ;
38
39
int is_newline ;
@@ -48,7 +49,7 @@ int readlines(char *filename, char **textlines) {
48
49
rewind (finp );
49
50
50
51
text = calloc (file_length + 1 , sizeof (char ));
51
- thisline = calloc (MAX_LINE_LENGTH , sizeof (char ));
52
+ thisline = calloc (MAX_LINE_LENGTH , sizeof (char ));
52
53
53
54
if (text == NULL ) {
54
55
printf ("\nnot enough memory to read file.\n" );
@@ -73,7 +74,7 @@ int readlines(char *filename, char **textlines) {
73
74
thisline [index ++ ] = * text ++ ;
74
75
}
75
76
thisline [index ] = '\0' ;
76
- thisline = strtrim (thisline );
77
+ thisline = strtrim (thisline );
77
78
++ ilen ;
78
79
textlines [ilen ]= calloc (strlen (thisline ) + 1 , sizeof (char ));
79
80
strcpy (textlines [ilen ], thisline );
You can’t perform that action at this time.
0 commit comments