diff --git a/src/lib/commands/bomb.c b/src/lib/commands/bomb.c index 4a2cbf06..bc39efc3 100644 --- a/src/lib/commands/bomb.c +++ b/src/lib/commands/bomb.c @@ -131,7 +131,7 @@ bomb(void) getsect(tx, ty, &target); ip = 0; ap_to_target = strlen(flightpath); - if (*(flightpath + strlen(flightpath) - 1) == 'h') + if (flightpath[ap_to_target - 1] == 'h') ap_to_target--; pr("range to target is %d\n", ap_to_target); /* diff --git a/src/lib/commands/drop.c b/src/lib/commands/drop.c index 2ade523e..a0aba4c6 100644 --- a/src/lib/commands/drop.c +++ b/src/lib/commands/drop.c @@ -101,7 +101,7 @@ drop(void) } ap_to_target = strlen(flightpath); - if (*(flightpath + strlen(flightpath) - 1) == 'h') + if (flightpath[ap_to_target - 1] == 'h') ap_to_target--; pr("range to target is %d\n", ap_to_target); /* diff --git a/src/lib/commands/fly.c b/src/lib/commands/fly.c index 722f3c14..747984ac 100644 --- a/src/lib/commands/fly.c +++ b/src/lib/commands/fly.c @@ -109,7 +109,7 @@ fly(void) } ap_to_target = strlen(flightpath); - if (*(flightpath + strlen(flightpath) - 1) == 'h') + if (flightpath[ap_to_target - 1] == 'h') ap_to_target--; pr("range to target is %d\n", ap_to_target); /* diff --git a/src/lib/commands/para.c b/src/lib/commands/para.c index 3ebbf3bb..f0bec69f 100644 --- a/src/lib/commands/para.c +++ b/src/lib/commands/para.c @@ -88,7 +88,7 @@ para(void) getsect(tx, ty, &target); pr("LZ is %s\n", xyas(tx, ty, player->cnum)); ap_to_target = strlen(flightpath); - if (*(flightpath + strlen(flightpath) - 1) == 'h') + if (flightpath[ap_to_target - 1] == 'h') ap_to_target--; pr("range to target is %d\n", ap_to_target); /* diff --git a/src/lib/commands/reco.c b/src/lib/commands/reco.c index 612b8c03..e1a5ba98 100644 --- a/src/lib/commands/reco.c +++ b/src/lib/commands/reco.c @@ -86,7 +86,7 @@ reco(void) if (pln_onewaymission(&target, &cno, &wantflags) < 0) return RET_SYN; ap_to_target = strlen(flightpath); - if (*(flightpath + strlen(flightpath) - 1) == 'h') + if (flightpath[ap_to_target - 1] == 'h') ap_to_target--; pr("range to target is %d\n", ap_to_target); /*