[comp.sources.bugs] Bug in less distribution

chinn@apcisea.UUCP (David Chinn) (09/12/87)

I just made 'less' and came across a minor annoyance.

I have an apollo, running SR9.6 and the bsd flavor of unix.

In the file 'os.c', stdio.h is not included until quite
far into the file, and when it is included, it 
declares (on apollos) sprintf to be 
                                    
        extern char *sprintf();

This is a problem, because on line 73 of os.c, 
sprintf is referenced prior to the declaration.  The 
c compiler makes the implicit assumption that the
function returns an integer, and so the re-declaration
is an error.

The simple solution is to put the include statement up
at the top of the file.

...uw-beaver                                    david m. chinnn
    !tikal!pilchuck                             apollo computer inc
        !apcisea!chinn                          bellevue, washington