Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 May 1996 19:09:55 -0400 (EDT)
From:      John Capo <jc@irbs.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1254: xroach cores with missing arguments
Message-ID:  <199605262309.TAA13704@irbs.irbs.com>
Resent-Message-ID: <199605262320.QAA06824@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1254
>Category:       bin
>Synopsis:       xroach cores with missing arguments
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 26 16:20:01 PDT 1996
>Last-Modified:
>Originator:     John Capo
>Organization:
>Release:        FreeBSD 2.1-STABLE i386
>Environment:

	

>Description:

Omit numeric arg with flag that expects one and xroach will core.

>How-To-Repeat:

xroach -roaches   will do it I think.

>Fix:

*** /usr/stable/src/games/x11/xroach/xroach.c	Sat May  4 21:18:41 1996
--- games/x11/xroach/xroach.c	Sat May  4 17:50:29 1996
***************
*** 96,114 ****
      /*
         Process command line options.
      */
!     for (ax=1; ax<ac; ax++) {
! 	arg = av[ax];
  	if (strcmp(arg, "-display") == 0) {
! 	    display_name = av[++ax];
  	}
  	else if (strcmp(arg, "-rc") == 0) {
! 	    roachColor = av[++ax];
  	}
  	else if (strcmp(arg, "-speed") == 0) {
! 	    roachSpeed = atof(av[++ax]);
  	}
  	else if (strcmp(arg, "-roaches") == 0) {
! 	    maxRoaches = strtol(av[++ax], (char **)NULL, 0);
  	}
  	else {
  	    Usage();
--- 96,118 ----
      /*
         Process command line options.
      */
!     for (ax=1; ax<ac; ) {
! 	arg = av[ax++];
! 
! 	if (ax >= ac)
! 	    Usage();
! 
  	if (strcmp(arg, "-display") == 0) {
! 	    display_name = av[ax++];
  	}
  	else if (strcmp(arg, "-rc") == 0) {
! 	    roachColor = av[ax++];
  	}
  	else if (strcmp(arg, "-speed") == 0) {
! 	    roachSpeed = atof(av[ax++]);
  	}
  	else if (strcmp(arg, "-roaches") == 0) {
! 	    maxRoaches = strtol(av[ax++], (char **)NULL, 0);
  	}
  	else {
  	    Usage();
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605262309.TAA13704>