comparison main.c @ 744:628c5bac7f3b

pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext) - 1 is unnecessary
author Anselm R. Garbe <arg@suckless.org>
date Fri, 09 Feb 2007 14:56:19 +0100
parents 1cb9ae0a0104
children
comparison
equal deleted inserted replaced
743:cb8b18d787d0 744:628c5bac7f3b
271 strncpy(stext, "EOF", 4); 271 strncpy(stext, "EOF", 4);
272 readin = False; 272 readin = False;
273 break; 273 break;
274 default: 274 default:
275 for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0'); 275 for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0');
276 for(p = stext + strlen(stext) - 1; p >= stext && *p != '\n'; --p); 276 for(; p >= stext && *p != '\n'; --p);
277 if(p > stext) 277 if(p > stext)
278 strncpy(stext, p + 1, sizeof stext); 278 strncpy(stext, p + 1, sizeof stext);
279 } 279 }
280 drawstatus(); 280 drawstatus();
281 } 281 }