[comp.sources.bugs] NULL pointer reference in fmt.c

bgray@marque.mu.edu (Bill Gray) (05/03/88)

Oops!  A friend pointed out a bug in the version of fmt.c that I
posted to comp.sources.misc a week (or two) ago.  The same
problem is present in the version that was modified and posted to
unix-pc.sources.

------------------------------------------------------------------------
*** fmt.c.ORIG  Mon May  2 10:25:08 1988
--- fmt.c       Mon May  2 10:35:06 1988
***************
*** 92,98 ****
                                copyindent();
                        }
                        p = strtok(ilp, delimiters);
!                       while (*p) {
                                putword(p);
                                p = strtok(NULL, delimiters);
                        }
--- 92,98 ----
                                copyindent();
                        }
                        p = strtok(ilp, delimiters);
!                       while (p) {
                                putword(p);
                                p = strtok(NULL, delimiters);
                        }
------------------------------------------------------------------------

Bill Gray
--
bgray@marque.mu.edu    { uwvax | uunet }!marque.mu.edu!bgray