From: arg@mig29 Date: Sun, 26 Nov 2006 14:43:16 +0000 (+0100) Subject: applied yet another proposal of Manuel X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=commitdiff_plain;h=2210ea7e3b0b2839ac7fb49c18d2731cb9e94e01;hp=61a1910f91fe6aba428193087d6c3ff21374ee5e applied yet another proposal of Manuel --- diff --git a/main.c b/main.c index f196df7..934bea4 100644 --- a/main.c +++ b/main.c @@ -284,8 +284,8 @@ main(int argc, char *argv[]) { readin = False; break; default: - stext[r - (stext[r - 1] == '\n' ? 1 : 0)] = '\0'; - for(p = stext + strlen(stext) - 1; p > stext && *p != '\n'; --p); + 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); if(p > stext) strncpy(stext, p + 1, sizeof stext); }