--- src/common.c.fix-crackrock Thu Dec 23 12:48:25 2004 +++ src/common.c Thu Dec 23 12:51:59 2004 @@ -19,6 +19,7 @@ * Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "common.h" #ifdef HAVE_CURSES #include "curses.h" @@ -612,17 +612,16 @@ int SetShowNoninter(int dev) { /* Change or display settings from the command line. */ - char *devstr, dest; + char *devstr; int change = 0, tmp, left, right; /* Increase or decrease levels, optionally by a number. */ if (!strncmp(optarg, "+", 1) || !strncmp(optarg, "-", 1)) { ErrorExitWarn(ReadLevel(dev, &tmp), 'e'); right = tmp >> 8; /* I'll take the high byte, */ left = tmp & 0xFF; /* and you take the low byte. */ - strncpy(&dest, (optarg + 1), 3); - change = 1; /* For compatibility with versions 1.15 to 1.17, assume one if no number was given. */ - if (atoi(&dest)) - change = atoi(&dest); + change = (int) strtol(optarg, NULL, 10); + if (errno) + change = 1; /* For compatibility with versions 1.15 to 1.17, assume one if no number was given. */ if (*optarg == '+') { /* increase */ right += change; left += change;