pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) - 1 is unnecessary
authorAnselm R. Garbe <arg@suckless.org>
Fri, 09 Feb 2007 14:56:19 +0100
changeset 744 628c5bac7f3b
parent 743 cb8b18d787d0
child 745 cf432071e646
pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) - 1 is unnecessary
main.c
--- a/main.c	Fri Feb 09 11:58:37 2007 +0100
+++ b/main.c	Fri Feb 09 14:56:19 2007 +0100
@@ -273,7 +273,7 @@
 				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);
 			}