applied yet another proposal of Manuel
arg@mig29 unknown
Sun, 26 Nov 2006 15:43:16 +0100
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
main.c
→
main.c
@@ -284,8 +284,8 @@ strncpy(stext, "EOF", sizeof stext);
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); }