Skip to content
Snippets Groups Projects
Commit 7ff76c44 authored by rswindell's avatar rswindell
Browse files

Only call toupper() once per loop in aftol().

parent 8bc84bd9
No related branches found
No related tags found
No related merge requests found
......@@ -844,12 +844,14 @@ char *readline(long *offset, char *outstr, int maxlen, FILE *instream)
/****************************************************************************/
long aftol(char *str)
{
char ch;
size_t c=0;
ulong l=0UL;
while(str[c]) {
if(toupper(str[c])>='A' && toupper(str[c])<='Z')
l|=FLAG(toupper(str[c]));
ch=toupper(str[c]);
if(ch>='A' && ch<='Z')
l|=FLAG(ch);
c++;
}
return(l);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment