pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) - 1 is unnecessary
Anselm R. Garbe arg@suckless.org
Fri, 09 Feb 2007 14:56:19 +0100
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
main.c
→
main.c
@@ -273,7 +273,7 @@ readin = False;
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); }