From: Anselm R. Garbe Date: Fri, 9 Feb 2007 13:56:19 +0000 (+0100) Subject: pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) -... X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=commitdiff_plain;h=fd995dac78e34cc427abd7198af0db957a40664a pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) - 1 is unnecessary --- diff --git a/main.c b/main.c index 1fd7ab1..02475e0 100644 --- a/main.c +++ b/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); }