Parcourir la source

pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) - 1 is unnecessary

Anselm R. Garbe il y a 18 ans
Parent
commit
fd995dac78
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      main.c

+ 1 - 1
main.c

@@ -273,7 +273,7 @@ main(int argc, char *argv[]) {
 				break;
 			default:
 				for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0');
-				for(p = stext + strlen(stext) - 1; p >= stext && *p != '\n'; --p);
+				for(; p >= stext && *p != '\n'; --p);
 				if(p > stext)
 					strncpy(stext, p + 1, sizeof stext);
 			}