Package: spell
Version: 1.0-12

Spell use char type variables to store results from getopt_long and
getc, which are supposed to return int types.  This results in error
conditions (such as EOF) not being detected properly.  As a result,
spell hangs in an infinite loop (either due to failure to detect end of
options from getopt_long, or failre to detect EOF from getc).  Patch
below fixes problems for me.

--- spell-1.0/spell.c   1996-04-10 00:41:09.000000000 -0400
+++ spell-1.0.local/spell.c     2005-07-02 10:49:54.000000000 -0400
@@ -159,7 +159,7 @@
 int
 main (int argc, char **argv)
 {
-  char opt = 0;                        /* Current option.  */
+  int opt = 0;                 /* Current option.  */
   int opt_error = 0;           /* Whether an option error occurred.  */
   int show_help = 0;           /* Display help (--help, -h).  */
   int show_version = 0;                /* Display the version (--version, -V). 
 */
Only in spell-1.0.local/: spell.o
diff -r -u spell-1.0/str.c spell-1.0.local/str.c
--- spell-1.0/str.c     2005-07-02 10:50:29.000000000 -0400
+++ spell-1.0.local/str.c       2005-07-02 10:41:54.000000000 -0400
@@ -136,12 +136,12 @@
 
   while (1)
     {
-      register char c = getc (stream);
+      register int c = getc (stream);
 
       if (c == EOF || ferror (stream))
        return ADD_LINE_EOF;
-      str_add_char (str, c);
-      if (c == '\n')
+      str_add_char (str, (char)c);
+      if ((char)c == '\n')
        break;
     }
 


-- 
Michal Ostrowski

Attachment: pgp0EWoYbZhlI.pgp
Description: PGP signature

Reply via email to