changeset: 744:628c5bac7f3b
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Fri Feb 09 14:56:19 2007 +0100
summary: pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) - 1 is unnecessary
diff -r cb8b18d787d0 -r 628c5bac7f3b 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 @@ 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);
}
Received on Fri Feb 09 2007 - 15:00:54 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:04 UTC