(load_plane_ship, load_land_ship, load_plane_land, load_land_land):

isdigit() can return anything, not just 0 or 1, and you can't combine
its values with &=!  The bug could make loading operations fail
noisily instead of silently, depending on the system's implementation
of isdigit().
This commit is contained in:
Markus Armbruster 2007-11-15 19:42:28 +00:00
parent dab28b9780
commit 0e275b8507

View file

@ -377,8 +377,8 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
if (!still_ok_ship(sectp, sp))
return RET_SYN;
if (p && *p)
noisy &= isdigit(*p);
if (noisy && p && *p)
noisy = isdigit(*p);
while (nxtitem(&ni, &pln)) {
if (pln.pln_own != player->cnum)
@ -506,8 +506,8 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
if (!still_ok_ship(sectp, sp))
return RET_SYN;
if (p && *p)
noisy &= isdigit(*p);
if (noisy && p && *p)
noisy = isdigit(*p);
while (nxtitem(&ni, &land)) {
if (land.lnd_own != player->cnum)
@ -767,8 +767,8 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
if (!still_ok_land(sectp, lp))
return RET_SYN;
if (p && *p)
noisy &= isdigit(*p);
if (noisy && p && *p)
noisy = isdigit(*p);
if (sectp->sct_own != player->cnum && load_unload == LOAD) {
pr("Sector %s is not yours.\n",
@ -950,8 +950,8 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
if (!still_ok_land(sectp, lp))
return RET_SYN;
if (p && *p)
noisy &= isdigit(*p);
if (noisy && p && *p)
noisy = isdigit(*p);
while (nxtitem(&ni, &land)) {