(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:
parent
dab28b9780
commit
0e275b8507
1 changed files with 8 additions and 8 deletions
|
@ -377,8 +377,8 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
|
||||||
if (!still_ok_ship(sectp, sp))
|
if (!still_ok_ship(sectp, sp))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
if (p && *p)
|
if (noisy && p && *p)
|
||||||
noisy &= isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
while (nxtitem(&ni, &pln)) {
|
while (nxtitem(&ni, &pln)) {
|
||||||
if (pln.pln_own != player->cnum)
|
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))
|
if (!still_ok_ship(sectp, sp))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
if (p && *p)
|
if (noisy && p && *p)
|
||||||
noisy &= isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
while (nxtitem(&ni, &land)) {
|
while (nxtitem(&ni, &land)) {
|
||||||
if (land.lnd_own != player->cnum)
|
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))
|
if (!still_ok_land(sectp, lp))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
if (p && *p)
|
if (noisy && p && *p)
|
||||||
noisy &= isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
if (sectp->sct_own != player->cnum && load_unload == LOAD) {
|
if (sectp->sct_own != player->cnum && load_unload == LOAD) {
|
||||||
pr("Sector %s is not yours.\n",
|
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))
|
if (!still_ok_land(sectp, lp))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
if (p && *p)
|
if (noisy && p && *p)
|
||||||
noisy &= isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
while (nxtitem(&ni, &land)) {
|
while (nxtitem(&ni, &land)) {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue