[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs 21.2] yow.c might loop endlessly on malformed yow.lines
From: |
Andreas Schwab |
Subject: |
Re: [emacs 21.2] yow.c might loop endlessly on malformed yow.lines |
Date: |
Thu, 26 Sep 2002 12:11:29 +0200 |
User-agent: |
Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (ia64-suse-linux) |
Philipp Rumpf <prumpf@parcelfarce.linux.theplanet.co.uk> writes:
|> I'm not sure this is worth fixing, but as of version 21.2 we seem to try
|> to install the yow executable so it probably shouldn't be buggy.
Can you explain the bug, please? I don't see anything wrong.
|> diff -ur emacs-21.2/lib-src/yow.c emacs-21.2-mod/lib-src/yow.c
|> --- emacs-21.2/lib-src/yow.c Fri Feb 26 12:37:05 1999
|> +++ emacs-21.2-mod/lib-src/yow.c Wed Sep 25 22:54:51 2002
|> @@ -86,7 +86,7 @@
|> /* Because the header (stuff before the first SEP) can be very long,
|> * thus biasing our search in favor of the first quotation in the file,
|> * we explicitly skip that. */
|> - while ((c = getc(fp)) != SEP) {
|> + while ((c = getc(fp)) != SEP && c != EOF) {
|> if (c == EOF) {
|> fprintf(stderr, "yow: file contains no separators\n");
|> exit(2);
|> @@ -123,7 +123,7 @@
|> /* Read until SEP, read next line, print it.
|> (Note that we will never print anything before the first separator.)
|> If we hit EOF looking for the first SEP, just recurse. */
|> - while ((c = getc(fp)) != SEP)
|> + while ((c = getc(fp)) != SEP && c != EOF)
|> if (c == EOF) {
|> yow(fp);
|> return;
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."