(index, rindex): Obsolete BSDisms; remove. Use standard strchr() and
strrchr() instead. (setbuffer): Obsolete BSDism, unused; remove.
This commit is contained in:
parent
4ae9c417b3
commit
64afd7747b
16 changed files with 29 additions and 227 deletions
|
@ -34,6 +34,7 @@
|
|||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "player.h"
|
||||
#include "var.h"
|
||||
|
@ -116,7 +117,7 @@ bomb(void)
|
|||
getstarg(player->argp[3], "pinpoint, or strategic? ", buf)) == 0)
|
||||
return RET_SYN;
|
||||
mission = *p;
|
||||
if (index("ps", mission) == 0)
|
||||
if (strchr("ps", mission) == 0)
|
||||
return RET_SYN;
|
||||
if ((p = getstarg(player->argp[4], "assembly point? ", buf)) == 0
|
||||
|| *p == 0)
|
||||
|
|
|
@ -114,7 +114,7 @@ info(void)
|
|||
/*
|
||||
* don't let sneaky people go outside the info directory
|
||||
*/
|
||||
else if (NULL != (bp = rindex(player->argp[1], '/')))
|
||||
else if (NULL != (bp = strrchr(player->argp[1], '/')))
|
||||
bp++;
|
||||
else
|
||||
bp = player->argp[1];
|
||||
|
@ -394,11 +394,11 @@ info(void)
|
|||
* don't let sneaky people go outside the info directory
|
||||
*/
|
||||
bp = player->argp[1];
|
||||
if (NULL != (bp2 = rindex(bp, '/')))
|
||||
if (NULL != (bp2 = strrchr(bp, '/')))
|
||||
bp = ++bp2;
|
||||
if (NULL != (bp2 = rindex(bp, '\\')))
|
||||
if (NULL != (bp2 = strrchr(bp, '\\')))
|
||||
bp = ++bp2;
|
||||
if (NULL != (bp2 = rindex(bp, ':')))
|
||||
if (NULL != (bp2 = strrchr(bp, ':')))
|
||||
bp = ++bp2;
|
||||
if (!*bp)
|
||||
bp = "TOP";
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "player.h"
|
||||
#include "file.h"
|
||||
|
@ -54,7 +55,7 @@ offs(void)
|
|||
yorg = natp->nat_yorg;
|
||||
if (!(cp = getstarg(player->argp[1], "sector or nation? ", buf)))
|
||||
return RET_SYN;
|
||||
if (index(cp, ',')) { /* x, y pair for offset */
|
||||
if (strchr(cp, ',')) { /* x, y pair for offset */
|
||||
if (!sarg_xy(cp, &dx, &dy)) {
|
||||
pr("Bad sector designation.\n");
|
||||
return RET_SYN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue