Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast characters to unsigned char before passed to isspace() #103

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/iniparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ static unsigned strstrip(char * s)
if (s==NULL) return 0;

last = s + strlen(s);
while (isspace((int)*s) && *s) s++;
while (isspace((unsigned char)*s) && *s) s++;
while (last > s) {
if (!isspace((int)*(last-1)))
if (!isspace((unsigned char)*(last-1)))
break ;
last -- ;
}
Expand Down Expand Up @@ -763,7 +763,7 @@ dictionary * iniparser_load(const char * ininame)
}
/* Get rid of \n and spaces at end of line */
while ((len>=0) &&
((line[len]=='\n') || (isspace(line[len])))) {
((line[len]=='\n') || (isspace((unsigned char)line[len])))) {
line[len]=0 ;
len-- ;
}
Expand Down