Add end of line check so mkinit doesn't produce garbage if you have a

MKINIT line that doesn't have a comment on it (we have at least two).

This mkinit program was written by someone who obviously doesn't believe
in defensive programming. :-(  There's a LOT of work that needs to be done
on this thing. :-( :-( :-(
This commit is contained in:
Paul Traina 1994-11-06 06:27:04 +00:00
parent 2fe6e4d71e
commit a0334cef15
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4204

View file

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: mkinit.c,v 1.2 1994/09/24 02:57:54 davidg Exp $
*/
#ifndef lint
@ -352,7 +352,7 @@ dodecl(line1, fp)
if (! amiddecls)
addchar('\n', &decls);
q = NULL;
for (p = line1 + 6 ; *p != '=' && *p != '/' ; p++);
for (p = line1 + 6 ; *p != '=' && *p != '/' && *p != '\n'; p++);
if (*p == '=') { /* eliminate initialization */
for (q = p ; *q && *q != ';' ; q++);
if (*q == '\0')