comparison 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
comparison
equal deleted inserted replaced
112:ee250e3646fd 113:aa582a02eb5d
122 /* 122 /*
123 * loop reading in the string, and put it in a temporary buffer 123 * loop reading in the string, and put it in a temporary buffer
124 */ 124 */
125 for (sp = buf; (c=readchar(awin)) != '\n' && c != '\r' && c != ESCAPE; 125 for (sp = buf; (c=readchar(awin)) != '\n' && c != '\r' && c != ESCAPE;
126 wclrtoeol(awin), draw(awin)) { 126 wclrtoeol(awin), draw(awin)) {
127 if (( (int)sp - (int)buf ) >= 50) { 127 if (sp - buf >= 50) {
128 *sp = '\0'; /* line was too long */ 128 *sp = '\0'; /* line was too long */
129 strucpy(opt,buf,strlen(buf)); 129 strucpy(opt,buf,strlen(buf));
130 mvwaddstr(awin, 0, 0, "Name was truncated --More--"); 130 mvwaddstr(awin, 0, 0, "Name was truncated --More--");
131 wclrtoeol(awin); 131 wclrtoeol(awin);
132 draw(awin); 132 draw(awin);