The old code checked a bunch of other things first, which made it hard
to see that the value of onearg() was checked properly.
sprintf(prompt, "Number of %s to explore with? (max %d) ",
ip->i_name, amt_src);
amount = onearg(player->argp[3], prompt);
+ if (amount <= 0)
+ return RET_SYN;
if (!check_sect_ok(§))
return RET_FAIL;
if (amount > amt_src) {
if (!check_sect_ok(§))
return RET_FAIL;
- if (amount <= 0)
- return RET_SYN;
weight = (double)amount * ip->i_lbs;
/* remove commodities from source sector */
getsect(x, y, &start);