From dff96acf36f333d2d2c0452bb8426ec8fbfe4ae4 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Thu, 27 Mar 2014 11:09:30 -0700 Subject: [PATCH] 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). --- srogue/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srogue/options.c b/srogue/options.c index fa51e25..74a5929 100644 --- a/srogue/options.c +++ b/srogue/options.c @@ -124,7 +124,7 @@ WINDOW *awin; */ 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--");