[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs 21.2] yow.c might loop endlessly on malformed yow.lines
From: |
Philipp Rumpf |
Subject: |
[emacs 21.2] yow.c might loop endlessly on malformed yow.lines |
Date: |
Wed, 25 Sep 2002 22:08:02 +0100 |
User-agent: |
Mutt/1.2.5.1i |
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.
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;
- [emacs 21.2] yow.c might loop endlessly on malformed yow.lines,
Philipp Rumpf <=