Skip to content

Commit 9987dfc

Browse files
committed
add include of ctype.h which is the proper place for isspace(), required by clang
1 parent 7d72eb9 commit 9987dfc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

c/strutil.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <stdlib.h>
55
#include <string.h>
66
#include <errno.h>
7+
#include <ctype.h>
78

89
#include "strutil.h"
910

@@ -32,7 +33,7 @@ int readlines(char *filename, char **textlines) {
3233
as char *text[MAX] */
3334

3435
FILE *finp;
35-
char *thisline ;
36+
char *thisline ;
3637
char *text, *c;
3738
long file_length, index, i, ilen;
3839
int is_newline;
@@ -48,7 +49,7 @@ int readlines(char *filename, char **textlines) {
4849
rewind(finp);
4950

5051
text = calloc(file_length + 1, sizeof(char));
51-
thisline = calloc(MAX_LINE_LENGTH, sizeof(char));
52+
thisline = calloc(MAX_LINE_LENGTH, sizeof(char));
5253

5354
if (text == NULL ) {
5455
printf("\nnot enough memory to read file.\n");
@@ -73,7 +74,7 @@ int readlines(char *filename, char **textlines) {
7374
thisline[index++] = *text++;
7475
}
7576
thisline[index] = '\0';
76-
thisline = strtrim(thisline);
77+
thisline = strtrim(thisline);
7778
++ilen;
7879
textlines[ilen]= calloc(strlen(thisline) + 1, sizeof(char));
7980
strcpy(textlines[ilen], thisline);

0 commit comments

Comments
 (0)