Mercurial > hg > early-roguelike
diff srogue/options.c @ 113:aa582a02eb5d
srogue: remove unnecessary pointer cast.
Casting char* to int before a comparison doesn't alter the result, and
isn't safe if sizeof(char *) != sizeof(int).
author | John "Elwin" Edwards |
---|---|
date | Thu, 27 Mar 2014 11:09:30 -0700 |
parents | 00baf21eb047 |
children | 458df24e973d |
line wrap: on
line diff
--- a/srogue/options.c Sun Mar 23 21:27:14 2014 -0700 +++ b/srogue/options.c Thu Mar 27 11:09:30 2014 -0700 @@ -124,7 +124,7 @@ */ for (sp = buf; (c=readchar(awin)) != '\n' && c != '\r' && c != ESCAPE; wclrtoeol(awin), draw(awin)) { - if (( (int)sp - (int)buf ) >= 50) { + if (sp - buf >= 50) { *sp = '\0'; /* line was too long */ strucpy(opt,buf,strlen(buf)); mvwaddstr(awin, 0, 0, "Name was truncated --More--");