Removed dead stores.

This commit is contained in:
wyld-sw
2018-07-15 10:29:57 -04:00
parent 5cca63a01c
commit bf941bc9b2
28 changed files with 85 additions and 139 deletions

View File

@@ -72,7 +72,6 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod
if ((mode == 0) && obj->description) { if ((mode == 0) && obj->description) {
if (GET_OBJ_VAL(obj, 1) != 0 || OBJ_SAT_IN_BY(obj)) { if (GET_OBJ_VAL(obj, 1) != 0 || OBJ_SAT_IN_BY(obj)) {
temp = OBJ_SAT_IN_BY(obj);
for (temp = OBJ_SAT_IN_BY(obj); temp; temp = NEXT_SITTING(temp)) { for (temp = OBJ_SAT_IN_BY(obj); temp; temp = NEXT_SITTING(temp)) {
if (temp == ch) if (temp == ch)
found++; found++;
@@ -2543,8 +2542,7 @@ ACMD(do_areas)
len += tmp_len; len += tmp_len;
if (overlap_shown) { if (overlap_shown) {
tmp_len = snprintf(buf+len, sizeof(buf)-len, "Areas shown in \trred\tn may have some creatures outside the specified range.\r\n"); snprintf(buf+len, sizeof(buf)-len, "Areas shown in \trred\tn may have some creatures outside the specified range.\r\n");
len += tmp_len;
} }
if (zcount == 0) if (zcount == 0)

View File

@@ -770,8 +770,6 @@ ACMD(do_sit)
one_argument(argument, arg); one_argument(argument, arg);
if (!*arg)
found = 0;
if (!(furniture = get_obj_in_list_vis(ch, arg, NULL, world[ch->in_room].contents))) if (!(furniture = get_obj_in_list_vis(ch, arg, NULL, world[ch->in_room].contents)))
found = 0; found = 0;
else else

View File

@@ -1877,7 +1877,7 @@ struct last_entry *find_llog_entry(int punique, long idnum) {
static void mod_llog_entry(struct last_entry *llast,int type) { static void mod_llog_entry(struct last_entry *llast,int type) {
FILE *fp; FILE *fp;
struct last_entry mlast; struct last_entry mlast;
int size, recs, tmp, i, j; int size, recs, tmp;
if(!(fp=fopen(LAST_FILE,"r+"))) { if(!(fp=fopen(LAST_FILE,"r+"))) {
log("Error opening last_file for reading and writing."); log("Error opening last_file for reading and writing.");
@@ -1893,7 +1893,7 @@ static void mod_llog_entry(struct last_entry *llast,int type) {
* do (like searching for the last shutdown/etc..) */ * do (like searching for the last shutdown/etc..) */
for(tmp=recs; tmp > 0; tmp--) { for(tmp=recs; tmp > 0; tmp--) {
fseek(fp,-1*((long)sizeof(struct last_entry)),SEEK_CUR); fseek(fp,-1*((long)sizeof(struct last_entry)),SEEK_CUR);
i = fread(&mlast,sizeof(struct last_entry),1,fp); fread(&mlast,sizeof(struct last_entry),1,fp);
/* Another one to keep that stepback. */ /* Another one to keep that stepback. */
fseek(fp,-1*((long)sizeof(struct last_entry)),SEEK_CUR); fseek(fp,-1*((long)sizeof(struct last_entry)),SEEK_CUR);
@@ -1908,7 +1908,7 @@ static void mod_llog_entry(struct last_entry *llast,int type) {
} }
mlast.close_time=time(0); mlast.close_time=time(0);
/*write it, and we're done!*/ /*write it, and we're done!*/
j = fwrite(&mlast,sizeof(struct last_entry),1,fp); fwrite(&mlast,sizeof(struct last_entry),1,fp);
fclose(fp); fclose(fp);
return; return;
} }
@@ -1923,7 +1923,6 @@ static void mod_llog_entry(struct last_entry *llast,int type) {
void add_llog_entry(struct char_data *ch, int type) { void add_llog_entry(struct char_data *ch, int type) {
FILE *fp; FILE *fp;
struct last_entry *llast; struct last_entry *llast;
int i;
/* so if a char enteres a name, but bad password, otherwise loses link before /* so if a char enteres a name, but bad password, otherwise loses link before
* he gets a pref assinged, we won't record it */ * he gets a pref assinged, we won't record it */
@@ -1950,7 +1949,7 @@ void add_llog_entry(struct char_data *ch, int type) {
free(llast); free(llast);
return; return;
} }
i = fwrite(llast,sizeof(struct last_entry),1,fp); fwrite(llast,sizeof(struct last_entry),1,fp);
fclose(fp); fclose(fp);
} else { } else {
/* We've found a login - update it */ /* We've found a login - update it */
@@ -1962,7 +1961,7 @@ void add_llog_entry(struct char_data *ch, int type) {
void clean_llog_entries(void) { void clean_llog_entries(void) {
FILE *ofp, *nfp; FILE *ofp, *nfp;
struct last_entry mlast; struct last_entry mlast;
int recs, i, j; int recs;
if(!(ofp=fopen(LAST_FILE,"r"))) if(!(ofp=fopen(LAST_FILE,"r")))
return; /* no file, no gripe */ return; /* no file, no gripe */
@@ -1987,8 +1986,8 @@ void clean_llog_entries(void) {
/* copy the rest */ /* copy the rest */
while (!feof(ofp)) { while (!feof(ofp)) {
i = fread(&mlast,sizeof(struct last_entry),1,ofp); fread(&mlast,sizeof(struct last_entry),1,ofp);
j = fwrite(&mlast,sizeof(struct last_entry),1,nfp); fwrite(&mlast,sizeof(struct last_entry),1,nfp);
} }
fclose(ofp); fclose(ofp);
fclose(nfp); fclose(nfp);
@@ -2002,7 +2001,6 @@ static void list_llog_entries(struct char_data *ch)
{ {
FILE *fp; FILE *fp;
struct last_entry llast; struct last_entry llast;
int i;
char timestr[25]; char timestr[25];
if(!(fp=fopen(LAST_FILE,"r"))) { if(!(fp=fopen(LAST_FILE,"r"))) {
@@ -2010,14 +2008,14 @@ static void list_llog_entries(struct char_data *ch)
send_to_char(ch, "Error! - no last log"); send_to_char(ch, "Error! - no last log");
} }
send_to_char(ch, "Last log\r\n"); send_to_char(ch, "Last log\r\n");
i = fread(&llast, sizeof(struct last_entry), 1, fp); fread(&llast, sizeof(struct last_entry), 1, fp);
strftime(timestr, sizeof(timestr), "%a %b %d %Y %H:%M:%S", localtime(&llast.time)); strftime(timestr, sizeof(timestr), "%a %b %d %Y %H:%M:%S", localtime(&llast.time));
while(!feof(fp)) { while(!feof(fp)) {
send_to_char(ch, "%10s\t%d\t%s\t%s\r\n", llast.username, llast.punique, send_to_char(ch, "%10s\t%d\t%s\t%s\r\n", llast.username, llast.punique,
last_array[llast.close_type], timestr); last_array[llast.close_type], timestr);
i = fread(&llast, sizeof(struct last_entry), 1, fp); fread(&llast, sizeof(struct last_entry), 1, fp);
} }
} }
@@ -2039,7 +2037,7 @@ ACMD(do_last)
time_t delta; time_t delta;
struct char_data *vict = NULL; struct char_data *vict = NULL;
struct char_data *temp; struct char_data *temp;
int recs, i, num = 0; int recs, num = 0;
FILE *fp; FILE *fp;
struct last_entry mlast; struct last_entry mlast;
@@ -2097,7 +2095,7 @@ ACMD(do_last)
send_to_char(ch, "Last log\r\n"); send_to_char(ch, "Last log\r\n");
while(num > 0 && recs > 0) { while(num > 0 && recs > 0) {
fseek(fp,-1* ((long)sizeof(struct last_entry)),SEEK_CUR); fseek(fp,-1* ((long)sizeof(struct last_entry)),SEEK_CUR);
i = fread(&mlast,sizeof(struct last_entry),1,fp); fread(&mlast,sizeof(struct last_entry),1,fp);
fseek(fp,-1*((long)sizeof(struct last_entry)),SEEK_CUR); fseek(fp,-1*((long)sizeof(struct last_entry)),SEEK_CUR);
if(!*name ||(*name && !str_cmp(name, mlast.username))) { if(!*name ||(*name && !str_cmp(name, mlast.username))) {
strftime(timestr, sizeof(timestr), "%a %b %d %Y %H:%M", localtime(&mlast.time)); strftime(timestr, sizeof(timestr), "%a %b %d %Y %H:%M", localtime(&mlast.time));
@@ -2180,7 +2178,6 @@ ACMD(do_wiznet)
buf2[MAX_INPUT_LENGTH + MAX_NAME_LENGTH + 32]; buf2[MAX_INPUT_LENGTH + MAX_NAME_LENGTH + 32];
struct descriptor_data *d; struct descriptor_data *d;
char emote = FALSE; char emote = FALSE;
char any = FALSE;
int level = LVL_IMMORT; int level = LVL_IMMORT;
skip_spaces(&argument); skip_spaces(&argument);
@@ -2207,7 +2204,7 @@ ACMD(do_wiznet)
case '@': case '@':
send_to_char(ch, "God channel status:\r\n"); send_to_char(ch, "God channel status:\r\n");
for (any = 0, d = descriptor_list; d; d = d->next) { for (d = descriptor_list; d; d = d->next) {
if (STATE(d) != CON_PLAYING || GET_LEVEL(d->character) < LVL_IMMORT) if (STATE(d) != CON_PLAYING || GET_LEVEL(d->character) < LVL_IMMORT)
continue; continue;
if (!CAN_SEE(ch, d->character)) if (!CAN_SEE(ch, d->character))
@@ -2422,7 +2419,7 @@ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int l
zone_table[zone].age, zone_table[zone].lifespan, zone_table[zone].age, zone_table[zone].lifespan,
zone_table[zone].reset_mode ? ((zone_table[zone].reset_mode == 1) ? "Reset when no players are in zone" : "Normal reset") : "Never reset", zone_table[zone].reset_mode ? ((zone_table[zone].reset_mode == 1) ? "Reset when no players are in zone" : "Normal reset") : "Never reset",
zone_table[zone].bot, zone_table[zone].top); zone_table[zone].bot, zone_table[zone].top);
i = j = k = l = m = n = o = 0; j = k = l = m = n = o = 0;
for (i = 0; i < top_of_world; i++) for (i = 0; i < top_of_world; i++)
if (world[i].number >= zone_table[zone].bot && world[i].number <= zone_table[zone].top) if (world[i].number >= zone_table[zone].bot && world[i].number <= zone_table[zone].top)
@@ -3666,7 +3663,7 @@ ACMD (do_zcheck)
"- Neither SENTINEL nor STAY_ZONE bits set.\r\n"); "- Neither SENTINEL nor STAY_ZONE bits set.\r\n");
if (MOB_FLAGGED(mob, MOB_SPEC) && (found = 1)) if (MOB_FLAGGED(mob, MOB_SPEC) && (found = 1))
len += snprintf(buf + len, sizeof(buf) - len, snprintf(buf + len, sizeof(buf) - len,
"- SPEC flag needs to be removed.\r\n"); "- SPEC flag needs to be removed.\r\n");
/* Additional mob checks.*/ /* Additional mob checks.*/
@@ -3804,7 +3801,7 @@ ACMD (do_zcheck)
ext2 = ext; ext2 = ext;
if (ext2 && (found = 1)) if (ext2 && (found = 1))
len += snprintf(buf + len, sizeof(buf) - len, snprintf(buf + len, sizeof(buf) - len,
"- has unformatted extra description\r\n"); "- has unformatted extra description\r\n");
/* Additional object checks. */ /* Additional object checks. */
if (found) { if (found) {
@@ -4153,7 +4150,6 @@ ACMD(do_copyover)
FILE *fp; FILE *fp;
struct descriptor_data *d, *d_next; struct descriptor_data *d, *d_next;
char buf [100], buf2[100]; char buf [100], buf2[100];
int i;
fp = fopen (COPYOVER_FILE, "w"); fp = fopen (COPYOVER_FILE, "w");
if (!fp) { if (!fp) {
@@ -4199,7 +4195,7 @@ ACMD(do_copyover)
sprintf (buf2, "-C%d", mother_desc); sprintf (buf2, "-C%d", mother_desc);
/* Ugh, seems it is expected we are 1 step above lib - this may be dangerous! */ /* Ugh, seems it is expected we are 1 step above lib - this may be dangerous! */
i = chdir (".."); chdir ("..");
/* Close reserve and other always-open files and release other resources */ /* Close reserve and other always-open files and release other resources */
execl (EXE_FILE, "circle", buf2, buf, (char *) NULL); execl (EXE_FILE, "circle", buf2, buf, (char *) NULL);
@@ -4229,17 +4225,15 @@ ACMD(do_peace)
ACMD(do_zpurge) ACMD(do_zpurge)
{ {
int vroom, room, vzone = 0, zone = 0; int vroom, room, zone = 0;
char arg[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH];
int purge_all = FALSE; int purge_all = FALSE;
one_argument(argument, arg); one_argument(argument, arg);
if (*arg == '.' || !*arg) { if (*arg == '.' || !*arg) {
zone = world[IN_ROOM(ch)].zone; zone = world[IN_ROOM(ch)].zone;
vzone = zone_table[zone].number;
} }
else if (is_number(arg)) { else if (is_number(arg)) {
vzone = atoi(arg); zone = real_zone(atoi(arg));
zone = real_zone(vzone);
if (zone == NOWHERE || zone > top_of_zone_table) { if (zone == NOWHERE || zone > top_of_zone_table) {
send_to_char(ch, "That zone doesn't exist!\r\n"); send_to_char(ch, "That zone doesn't exist!\r\n");
return; return;
@@ -4291,7 +4285,7 @@ ACMD(do_file)
int req_file_lines = 0; /* Number of total lines in file to be read. */ int req_file_lines = 0; /* Number of total lines in file to be read. */
int lines_read = 0; /* Counts total number of lines read from the file. */ int lines_read = 0; /* Counts total number of lines read from the file. */
int req_lines = 0; /* Number of lines requested to be displayed. */ int req_lines = 0; /* Number of lines requested to be displayed. */
int i, j; /* Generic loop counters. */ int i; /* Generic loop counter. */
int l; /* Marks choice of file in fields array. */ int l; /* Marks choice of file in fields array. */
char field[MAX_INPUT_LENGTH]; /* Holds users choice of file to be read. */ char field[MAX_INPUT_LENGTH]; /* Holds users choice of file to be read. */
char value[MAX_INPUT_LENGTH]; /* Holds # lines to be read, if requested. */ char value[MAX_INPUT_LENGTH]; /* Holds # lines to be read, if requested. */
@@ -4335,7 +4329,7 @@ ACMD(do_file)
/* Display usage if no argument. */ /* Display usage if no argument. */
if (!*argument) { if (!*argument) {
send_to_char(ch, "USAGE: file <filename> <num lines>\r\n\r\nFile options:\r\n"); send_to_char(ch, "USAGE: file <filename> <num lines>\r\n\r\nFile options:\r\n");
for (j = 0, i = 0; fields[i].level; i++) for (i = 0; fields[i].level; i++)
if (fields[i].level <= GET_LEVEL(ch)) if (fields[i].level <= GET_LEVEL(ch))
send_to_char(ch, "%-15s%s\r\n", fields[i].cmd, fields[i].file); send_to_char(ch, "%-15s%s\r\n", fields[i].cmd, fields[i].file);
return; return;

View File

@@ -185,7 +185,7 @@ static void aedit_save_internally(struct descriptor_data *d) {
} }
/* pass the editted action back to the list - no need to add */ /* pass the editted action back to the list - no need to add */
else { else {
i = aedit_find_command(OLC_ACTION(d)->command); aedit_find_command(OLC_ACTION(d)->command);
OLC_ACTION(d)->act_nr = soc_mess_list[OLC_ZNUM(d)].act_nr; OLC_ACTION(d)->act_nr = soc_mess_list[OLC_ZNUM(d)].act_nr;
/* why did i do this..? hrm */ /* why did i do this..? hrm */
free_action(soc_mess_list + OLC_ZNUM(d)); free_action(soc_mess_list + OLC_ZNUM(d));

View File

@@ -516,7 +516,7 @@ static void perform_map( struct char_data *ch, char *argument, bool worldmap )
count += sprintf(buf + count, "\tn%s Swim\\\\", map_info[SECT_WATER_SWIM].disp); count += sprintf(buf + count, "\tn%s Swim\\\\", map_info[SECT_WATER_SWIM].disp);
count += sprintf(buf + count, "\tn%s Boat\\\\", map_info[SECT_WATER_NOSWIM].disp); count += sprintf(buf + count, "\tn%s Boat\\\\", map_info[SECT_WATER_NOSWIM].disp);
count += sprintf(buf + count, "\tn%s Flying\\\\", map_info[SECT_FLYING].disp); count += sprintf(buf + count, "\tn%s Flying\\\\", map_info[SECT_FLYING].disp);
count += sprintf(buf + count, "\tn%s Underwater\\\\", map_info[SECT_UNDERWATER].disp); sprintf(buf + count, "\tn%s Underwater\\\\", map_info[SECT_UNDERWATER].disp);
strcpy(buf, strfrmt(buf, LEGEND_WIDTH, CANVAS_HEIGHT + 2, FALSE, TRUE, TRUE)); strcpy(buf, strfrmt(buf, LEGEND_WIDTH, CANVAS_HEIGHT + 2, FALSE, TRUE, TRUE));

View File

@@ -409,7 +409,7 @@ int board_remove_msg(int board_type, struct char_data *ch, char *arg, struct obj
void board_save_board(int board_type) void board_save_board(int board_type)
{ {
FILE *fl; FILE *fl;
int i, j; int i;
char *tmp1, *tmp2 = NULL; char *tmp1, *tmp2 = NULL;
if (!num_of_msgs[board_type]) { if (!num_of_msgs[board_type]) {
@@ -420,7 +420,7 @@ void board_save_board(int board_type)
perror("SYSERR: Error writing board"); perror("SYSERR: Error writing board");
return; return;
} }
j = fwrite(&(num_of_msgs[board_type]), sizeof(int), 1, fl); fwrite(&(num_of_msgs[board_type]), sizeof(int), 1, fl);
for (i = 0; i < num_of_msgs[board_type]; i++) { for (i = 0; i < num_of_msgs[board_type]; i++) {
if ((tmp1 = MSG_HEADING(board_type, i)) != NULL) if ((tmp1 = MSG_HEADING(board_type, i)) != NULL)
@@ -435,11 +435,11 @@ void board_save_board(int board_type)
else else
msg_index[board_type][i].message_len = strlen(tmp2) + 1; msg_index[board_type][i].message_len = strlen(tmp2) + 1;
j = fwrite(&(msg_index[board_type][i]), sizeof(struct board_msginfo), 1, fl); fwrite(&(msg_index[board_type][i]), sizeof(struct board_msginfo), 1, fl);
if (tmp1) if (tmp1)
j = fwrite(tmp1, sizeof(char), msg_index[board_type][i].heading_len, fl); fwrite(tmp1, sizeof(char), msg_index[board_type][i].heading_len, fl);
if (tmp2) if (tmp2)
j = fwrite(tmp2, sizeof(char), msg_index[board_type][i].message_len, fl); fwrite(tmp2, sizeof(char), msg_index[board_type][i].message_len, fl);
} }
fclose(fl); fclose(fl);
@@ -448,7 +448,7 @@ void board_save_board(int board_type)
void board_load_board(int board_type) void board_load_board(int board_type)
{ {
FILE *fl; FILE *fl;
int i, j, len1, len2; int i, len1, len2;
char *tmp1, *tmp2; char *tmp1, *tmp2;
if (!(fl = fopen(FILENAME(board_type), "rb"))) { if (!(fl = fopen(FILENAME(board_type), "rb"))) {
@@ -464,14 +464,14 @@ void board_load_board(int board_type)
return; return;
} }
for (i = 0; i < num_of_msgs[board_type]; i++) { for (i = 0; i < num_of_msgs[board_type]; i++) {
j = fread(&(msg_index[board_type][i]), sizeof(struct board_msginfo), 1, fl); fread(&(msg_index[board_type][i]), sizeof(struct board_msginfo), 1, fl);
if ((len1 = msg_index[board_type][i].heading_len) <= 0) { if ((len1 = msg_index[board_type][i].heading_len) <= 0) {
log("SYSERR: Board file %d corrupt! Resetting.", board_type); log("SYSERR: Board file %d corrupt! Resetting.", board_type);
board_reset_board(board_type); board_reset_board(board_type);
return; return;
} }
CREATE(tmp1, char, len1); CREATE(tmp1, char, len1);
j = fread(tmp1, sizeof(char), len1, fl); fread(tmp1, sizeof(char), len1, fl);
MSG_HEADING(board_type, i) = tmp1; MSG_HEADING(board_type, i) = tmp1;
if ((MSG_SLOTNUM(board_type, i) = find_slot()) == -1) { if ((MSG_SLOTNUM(board_type, i) = find_slot()) == -1) {
@@ -481,7 +481,7 @@ void board_load_board(int board_type)
} }
if ((len2 = msg_index[board_type][i].message_len) > 0) { if ((len2 = msg_index[board_type][i].message_len) > 0) {
CREATE(tmp2, char, len2); CREATE(tmp2, char, len2);
j = fread(tmp2, sizeof(char), len2, fl); fread(tmp2, sizeof(char), len2, fl);
msg_storage[MSG_SLOTNUM(board_type, i)] = tmp2; msg_storage[MSG_SLOTNUM(board_type, i)] = tmp2;
} else } else
msg_storage[MSG_SLOTNUM(board_type, i)] = NULL; msg_storage[MSG_SLOTNUM(board_type, i)] = NULL;

View File

@@ -422,7 +422,7 @@ void copyover_recover()
for (;;) { for (;;) {
fOld = TRUE; fOld = TRUE;
i = fscanf (fp, "%d %ld %s %s %s\n", &desc, &pref, name, host, guiopt); fscanf (fp, "%d %ld %s %s %s\n", &desc, &pref, name, host, guiopt);
if (desc == -1) if (desc == -1)
break; break;

View File

@@ -155,10 +155,9 @@ static int hsort(const void *a, const void *b);
char *fread_action(FILE *fl, int nr) char *fread_action(FILE *fl, int nr)
{ {
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
char *buf1;
int i; int i;
buf1 = fgets(buf, MAX_STRING_LENGTH, fl); fgets(buf, MAX_STRING_LENGTH, fl);
if (feof(fl)) { if (feof(fl)) {
log("SYSERR: fread_action: unexpected EOF near action #%d", nr); log("SYSERR: fread_action: unexpected EOF near action #%d", nr);
/* SYSERR_DESC: fread_action() will fail if it discovers an end of file /* SYSERR_DESC: fread_action() will fail if it discovers an end of file
@@ -186,8 +185,8 @@ char *fread_action(FILE *fl, int nr)
static void boot_social_messages(void) static void boot_social_messages(void)
{ {
FILE *fl; FILE *fl;
int nr = 0, hide, min_char_pos, min_pos, min_lvl, curr_soc = -1, i; int nr = 0, hide, min_char_pos, min_pos, min_lvl, curr_soc = -1;
char next_soc[MAX_STRING_LENGTH], sorted[MAX_INPUT_LENGTH], *buf; char next_soc[MAX_STRING_LENGTH], sorted[MAX_INPUT_LENGTH];
if (CONFIG_NEW_SOCIALS == TRUE) { if (CONFIG_NEW_SOCIALS == TRUE) {
/* open social file */ /* open social file */
@@ -201,7 +200,7 @@ static void boot_social_messages(void)
/* count socials */ /* count socials */
*next_soc = '\0'; *next_soc = '\0';
while (!feof(fl)) { while (!feof(fl)) {
buf = fgets(next_soc, MAX_STRING_LENGTH, fl); fgets(next_soc, MAX_STRING_LENGTH, fl);
if (*next_soc == '~') top_of_socialt++; if (*next_soc == '~') top_of_socialt++;
} }
} else { /* old style */ } else { /* old style */
@@ -216,7 +215,7 @@ static void boot_social_messages(void)
} }
/* count socials */ /* count socials */
while (!feof(fl)) { while (!feof(fl)) {
buf = fgets(next_soc, MAX_STRING_LENGTH, fl); fgets(next_soc, MAX_STRING_LENGTH, fl);
if (*next_soc == '\n' || *next_soc == '\r') top_of_socialt++; /* all socials are followed by a blank line */ if (*next_soc == '\n' || *next_soc == '\r') top_of_socialt++; /* all socials are followed by a blank line */
} }
} }
@@ -228,7 +227,7 @@ static void boot_social_messages(void)
/* now read 'em */ /* now read 'em */
for (;;) { for (;;) {
i = fscanf(fl, " %s ", next_soc); fscanf(fl, " %s ", next_soc);
if (*next_soc == '$') break; if (*next_soc == '$') break;
if (CONFIG_NEW_SOCIALS == TRUE) { if (CONFIG_NEW_SOCIALS == TRUE) {
if (fscanf(fl, " %s %d %d %d %d \n", if (fscanf(fl, " %s %d %d %d %d \n",
@@ -795,12 +794,11 @@ static void reset_time(void)
{ {
time_t beginning_of_time = 0; time_t beginning_of_time = 0;
FILE *bgtime; FILE *bgtime;
int i;
if ((bgtime = fopen(TIME_FILE, "r")) == NULL) if ((bgtime = fopen(TIME_FILE, "r")) == NULL)
log("No time file '%s' starting from the beginning.", TIME_FILE); log("No time file '%s' starting from the beginning.", TIME_FILE);
else { else {
i = fscanf(bgtime, "%ld\n", (long *)&beginning_of_time); fscanf(bgtime, "%ld\n", (long *)&beginning_of_time);
fclose(bgtime); fclose(bgtime);
} }
@@ -913,7 +911,7 @@ void index_boot(int mode)
{ {
const char *index_filename, *prefix = NULL; /* NULL or egcs 1.1 complains */ const char *index_filename, *prefix = NULL; /* NULL or egcs 1.1 complains */
FILE *db_index, *db_file; FILE *db_index, *db_file;
int rec_count = 0, size[2], i; int rec_count = 0, size[2];
char buf2[PATH_MAX], buf1[MAX_STRING_LENGTH]; char buf2[PATH_MAX], buf1[MAX_STRING_LENGTH];
switch (mode) { switch (mode) {
@@ -958,13 +956,13 @@ void index_boot(int mode)
} }
/* first, count the number of records in the file so we can malloc */ /* first, count the number of records in the file so we can malloc */
i = fscanf(db_index, "%s\n", buf1); fscanf(db_index, "%s\n", buf1);
while (*buf1 != '$') { while (*buf1 != '$') {
snprintf(buf2, sizeof(buf2), "%s%s", prefix, buf1); snprintf(buf2, sizeof(buf2), "%s%s", prefix, buf1);
if (!(db_file = fopen(buf2, "r"))) { if (!(db_file = fopen(buf2, "r"))) {
log("SYSERR: File '%s' listed in '%s/%s': %s", buf2, prefix, log("SYSERR: File '%s' listed in '%s/%s': %s", buf2, prefix,
index_filename, strerror(errno)); index_filename, strerror(errno));
i = fscanf(db_index, "%s\n", buf1); fscanf(db_index, "%s\n", buf1);
continue; continue;
} else { } else {
if (mode == DB_BOOT_ZON) if (mode == DB_BOOT_ZON)
@@ -976,7 +974,7 @@ void index_boot(int mode)
} }
fclose(db_file); fclose(db_file);
i = fscanf(db_index, "%s\n", buf1); fscanf(db_index, "%s\n", buf1);
} }
/* Exit if 0 records, unless this is shops */ /* Exit if 0 records, unless this is shops */
@@ -1030,7 +1028,7 @@ void index_boot(int mode)
} }
rewind(db_index); rewind(db_index);
i = fscanf(db_index, "%s\n", buf1); fscanf(db_index, "%s\n", buf1);
while (*buf1 != '$') { while (*buf1 != '$') {
snprintf(buf2, sizeof(buf2), "%s%s", prefix, buf1); snprintf(buf2, sizeof(buf2), "%s%s", prefix, buf1);
if (!(db_file = fopen(buf2, "r"))) { if (!(db_file = fopen(buf2, "r"))) {
@@ -1057,7 +1055,7 @@ void index_boot(int mode)
} }
fclose(db_file); fclose(db_file);
i = fscanf(db_index, "%s\n", buf1); fscanf(db_index, "%s\n", buf1);
} }
fclose(db_index); fclose(db_index);

View File

@@ -92,9 +92,7 @@ void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, cha
one_argument(strcpy(buf2, t), t); one_argument(strcpy(buf2, t), t);
skip_spaces(&t); skip_spaces(&t);
} }
if (IS_SET(SINFO.targets, TAR_IGNORE)) { if (!IS_SET(SINFO.targets, TAR_IGNORE) && t != NULL && *t) {
target = TRUE;
} else if (t != NULL && *t) {
if (!target && if (!target &&
(IS_SET(SINFO.targets, TAR_CHAR_ROOM) || (IS_SET(SINFO.targets, TAR_CHAR_ROOM) ||
IS_SET(SINFO.targets, TAR_CHAR_WORLD))) { IS_SET(SINFO.targets, TAR_CHAR_WORLD))) {

View File

@@ -592,7 +592,7 @@ ACMD(do_mteleport)
if (AFF_FLAGGED(ch, AFF_CHARM)) if (AFF_FLAGGED(ch, AFF_CHARM))
return; return;
argument = two_arguments(argument, arg1, arg2); two_arguments(argument, arg1, arg2);
if (!*arg1 || !*arg2) { if (!*arg1 || !*arg2) {
mob_log(ch, "mteleport: bad syntax"); mob_log(ch, "mteleport: bad syntax");

View File

@@ -794,7 +794,7 @@ static void do_stat_trigger(struct char_data *ch, trig_data *trig)
len += snprintf(sb + len, sizeof(sb)-len, "%s\r\n", cmd_list->cmd); len += snprintf(sb + len, sizeof(sb)-len, "%s\r\n", cmd_list->cmd);
if (len>MAX_STRING_LENGTH-80) { if (len>MAX_STRING_LENGTH-80) {
len += snprintf(sb + len, sizeof(sb)-len, "*** Overflow - script too long! ***\r\n"); snprintf(sb + len, sizeof(sb)-len, "*** Overflow - script too long! ***\r\n");
break; break;
} }
@@ -1516,7 +1516,7 @@ static void eval_expr(char *line, char *result, void *go, struct script_data *sc
if (eval_lhs_op_rhs(line, result, go, sc, trig, type)); if (eval_lhs_op_rhs(line, result, go, sc, trig, type));
else if (*line == '(') { else if (*line == '(') {
p = strcpy(expr, line); strcpy(expr, line);
p = matching_paren(expr); p = matching_paren(expr);
*p = '\0'; *p = '\0';
eval_expr(expr + 1, result, go, sc, trig, type); eval_expr(expr + 1, result, go, sc, trig, type);
@@ -2179,12 +2179,12 @@ ACMD(do_vdelete)
struct script_data *sc_remote=NULL; struct script_data *sc_remote=NULL;
char *var, *uid_p; char *var, *uid_p;
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH]; char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
long uid, context; long uid;
room_data *room; room_data *room;
char_data *mob; char_data *mob;
obj_data *obj; obj_data *obj;
argument = two_arguments(argument, buf, buf2); two_arguments(argument, buf, buf2);
var = buf; var = buf;
uid_p = buf2; uid_p = buf2;
skip_spaces(&var); skip_spaces(&var);
@@ -2207,7 +2207,6 @@ ACMD(do_vdelete)
sc_remote = SCRIPT(room); sc_remote = SCRIPT(room);
} else if ((mob = find_char(uid))) { } else if ((mob = find_char(uid))) {
sc_remote = SCRIPT(mob); sc_remote = SCRIPT(mob);
if (!IS_NPC(mob)) context = 0;
} else if ((obj = find_obj(uid))) { } else if ((obj = find_obj(uid))) {
sc_remote = SCRIPT(obj); sc_remote = SCRIPT(obj);
} else { } else {
@@ -2287,7 +2286,7 @@ static void process_rdelete(struct script_data *sc, trig_data *trig, char *cmd)
struct script_data *sc_remote=NULL; struct script_data *sc_remote=NULL;
char *line, *var, *uid_p; char *line, *var, *uid_p;
char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH]; char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
long uid, context; long uid;
room_data *room; room_data *room;
char_data *mob; char_data *mob;
obj_data *obj; obj_data *obj;
@@ -2317,7 +2316,6 @@ static void process_rdelete(struct script_data *sc, trig_data *trig, char *cmd)
sc_remote = SCRIPT(room); sc_remote = SCRIPT(room);
} else if ((mob = find_char(uid))) { } else if ((mob = find_char(uid))) {
sc_remote = SCRIPT(mob); sc_remote = SCRIPT(mob);
if (!IS_NPC(mob)) context = 0;
} else if ((obj = find_obj(uid))) { } else if ((obj = find_obj(uid))) {
sc_remote = SCRIPT(obj); sc_remote = SCRIPT(obj);
} else { } else {

View File

@@ -727,7 +727,6 @@ void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to)
obj->next_content = obj_to->contains; obj->next_content = obj_to->contains;
obj_to->contains = obj; obj_to->contains = obj;
obj->in_obj = obj_to; obj->in_obj = obj_to;
tmp_obj = obj->in_obj;
/* Add weight to container, unless unlimited. */ /* Add weight to container, unless unlimited. */
if (GET_OBJ_VAL(obj->in_obj, 0) > 0) { if (GET_OBJ_VAL(obj->in_obj, 0) > 0) {
@@ -751,7 +750,6 @@ void obj_from_obj(struct obj_data *obj)
return; return;
} }
obj_from = obj->in_obj; obj_from = obj->in_obj;
temp = obj->in_obj;
REMOVE_FROM_LIST(obj, obj_from->contains, next_content); REMOVE_FROM_LIST(obj, obj_from->contains, next_content);
/* Subtract weight from containers container unless unlimited. */ /* Subtract weight from containers container unless unlimited. */

View File

@@ -385,7 +385,7 @@ ACMD(do_helpcheck)
} }
} }
if (count % 3 && len < sizeof(buf)) if (count % 3 && len < sizeof(buf))
nlen = snprintf(buf + len, sizeof(buf) - len, "\r\n"); snprintf(buf + len, sizeof(buf) - len, "\r\n");
if (ch->desc) { if (ch->desc) {
if (len == 0) if (len == 0)
@@ -431,12 +431,12 @@ ACMD(do_hindex)
if (!count) if (!count)
len += snprintf(buf + len, sizeof(buf) - len, " None.\r\n"); len += snprintf(buf + len, sizeof(buf) - len, " None.\r\n");
if (!count2) if (!count2)
len2 += snprintf(buf2 + len2, sizeof(buf2) - len2, " None.\r\n"); snprintf(buf2 + len2, sizeof(buf2) - len2, " None.\r\n");
// Join the two strings // Join the two strings
len += snprintf(buf + len, sizeof(buf) - len, "%s", buf2); len += snprintf(buf + len, sizeof(buf) - len, "%s", buf2);
len += snprintf(buf + len, sizeof(buf) - len, "\t1Applicable Index Entries: \t3%d\r\n" snprintf(buf + len, sizeof(buf) - len, "\t1Applicable Index Entries: \t3%d\r\n"
"\t1Total Index Entries: \t3%d\tn\r\n", count + count2, top_of_helpt); "\t1Total Index Entries: \t3%d\tn\r\n", count + count2, top_of_helpt);
page_string(ch->desc, buf, TRUE); page_string(ch->desc, buf, TRUE);

View File

@@ -287,22 +287,19 @@ void load_ibt_file(int mode)
void save_ibt_file(int mode) void save_ibt_file(int mode)
{ {
IBT_DATA *ibtData, *first_ibt, *last_ibt; IBT_DATA *ibtData, *first_ibt;
FILE *fp; FILE *fp;
char filename[256]; char filename[256];
switch(mode) { switch(mode) {
case SCMD_BUG : sprintf( filename, "%s",BUGS_FILE ); case SCMD_BUG : sprintf( filename, "%s",BUGS_FILE );
first_ibt = first_bug; first_ibt = first_bug;
last_ibt = last_bug;
break; break;
case SCMD_IDEA: sprintf( filename, "%s",IDEAS_FILE ); case SCMD_IDEA: sprintf( filename, "%s",IDEAS_FILE );
first_ibt = first_idea; first_ibt = first_idea;
last_ibt = last_idea;
break; break;
case SCMD_TYPO: sprintf( filename, "%s",TYPOS_FILE ); case SCMD_TYPO: sprintf( filename, "%s",TYPOS_FILE );
first_ibt = first_typo; first_ibt = first_typo;
last_ibt = last_typo;
break; break;
default : log("SYSERR: Invalid mode (%d) in save_ibt_file", mode); default : log("SYSERR: Invalid mode (%d) in save_ibt_file", mode);
return; return;
@@ -457,17 +454,16 @@ ACMD(do_ibt)
char buf[MAX_STRING_LENGTH], *arg_text, imp[30], timestr[128]; char buf[MAX_STRING_LENGTH], *arg_text, imp[30], timestr[128];
int i, num_res, num_unres; int i, num_res, num_unres;
size_t len = 0; size_t len = 0;
IBT_DATA *ibtData, *first_ibt, *last_ibt; IBT_DATA *ibtData, *first_ibt;
int ano=0; int ano=0;
if (IS_NPC(ch)) if (IS_NPC(ch))
return; return;
arg_text = one_argument(argument, arg); arg_text = one_argument(argument, arg);
argument = two_arguments(argument, arg, arg2); two_arguments(argument, arg, arg2);
first_ibt = get_first_ibt(subcmd); first_ibt = get_first_ibt(subcmd);
last_ibt = get_last_ibt(subcmd);
if ((!*arg)){ if ((!*arg)){
if (GET_LEVEL(ch) >= LVL_GRGOD){ if (GET_LEVEL(ch) >= LVL_GRGOD){
@@ -633,9 +629,9 @@ ACMD(do_ibt)
if (GET_LEVEL(ch) >= LVL_GRGOD) { if (GET_LEVEL(ch) >= LVL_GRGOD) {
len += snprintf(buf + len, sizeof(buf) - len, "%sYou may use %s remove, resolve or edit to change the list..%s\r\n", QCYN, CMD_NAME, QNRM); len += snprintf(buf + len, sizeof(buf) - len, "%sYou may use %s remove, resolve or edit to change the list..%s\r\n", QCYN, CMD_NAME, QNRM);
} }
len += snprintf(buf + len, sizeof(buf) - len, "%sYou may use %s%s show <number>%s to see more indepth about the %s.%s\r\n", QCYN, QYEL, CMD_NAME, QCYN, CMD_NAME, QNRM); snprintf(buf + len, sizeof(buf) - len, "%sYou may use %s%s show <number>%s to see more indepth about the %s.%s\r\n", QCYN, QYEL, CMD_NAME, QCYN, CMD_NAME, QNRM);
} else { } else {
len += snprintf(buf + len, sizeof(buf) - len, "No %ss have been reported!\r\n", CMD_NAME); snprintf(buf + len, sizeof(buf) - len, "No %ss have been reported!\r\n", CMD_NAME);
} }
page_string(ch->desc, buf, TRUE); page_string(ch->desc, buf, TRUE);
@@ -775,14 +771,14 @@ ACMD(do_oasis_ibtedit)
{ {
int number = NOTHING; int number = NOTHING;
struct descriptor_data *d; struct descriptor_data *d;
char buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH], *buf3; char buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
/* No editing as a mob or while being forced. */ /* No editing as a mob or while being forced. */
if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING) if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING)
return; return;
/* Parse any arguments */ /* Parse any arguments */
buf3 = two_arguments(argument, buf1, buf2); two_arguments(argument, buf1, buf2);
if (!*buf1) { if (!*buf1) {
send_to_char(ch, "Specify a %s number to edit.\r\n", ibt_types[subcmd]); send_to_char(ch, "Specify a %s number to edit.\r\n", ibt_types[subcmd]);

View File

@@ -1306,7 +1306,7 @@ EVENTFUNC(get_protocols)
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMXP\tO] \tw%s\tn | ", d->pProtocol->bMXP ? "Yes" : "No"); len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMXP\tO] \tw%s\tn | ", d->pProtocol->bMXP ? "Yes" : "No");
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMSDP\tO] \tw%s\tn | ", d->pProtocol->bMSDP ? "Yes" : "No"); len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMSDP\tO] \tw%s\tn | ", d->pProtocol->bMSDP ? "Yes" : "No");
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toATCP\tO] \tw%s\tn\r\n\r\n", d->pProtocol->bATCP ? "Yes" : "No"); snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toATCP\tO] \tw%s\tn\r\n\r\n", d->pProtocol->bATCP ? "Yes" : "No");
write_to_output(d, buf, 0); write_to_output(d, buf, 0);

View File

@@ -198,7 +198,6 @@ void run_autowiz(void)
if (CONFIG_USE_AUTOWIZ) { if (CONFIG_USE_AUTOWIZ) {
size_t res; size_t res;
char buf[256]; char buf[256];
int i;
#if defined(CIRCLE_UNIX) #if defined(CIRCLE_UNIX)
res = snprintf(buf, sizeof(buf), "nice ../bin/autowiz %d %s %d %s %d &", res = snprintf(buf, sizeof(buf), "nice ../bin/autowiz %d %s %d %s %d &",
@@ -212,7 +211,7 @@ void run_autowiz(void)
if (res < sizeof(buf)) { if (res < sizeof(buf)) {
mudlog(CMP, LVL_IMMORT, FALSE, "Initiating autowiz."); mudlog(CMP, LVL_IMMORT, FALSE, "Initiating autowiz.");
reboot_wizlists(); reboot_wizlists();
i = system(buf); system(buf);
} else } else
log("Cannot run autowiz: command-line doesn't fit in buffer."); log("Cannot run autowiz: command-line doesn't fit in buffer.");
} }

View File

@@ -45,7 +45,6 @@ ACMD(do_oasis_medit)
{ {
int number = NOBODY, save = 0, real_num; int number = NOBODY, save = 0, real_num;
struct descriptor_data *d; struct descriptor_data *d;
char *buf3;
char buf1[MAX_STRING_LENGTH]; char buf1[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
@@ -54,7 +53,7 @@ ACMD(do_oasis_medit)
return; return;
/* Parse any arguments */ /* Parse any arguments */
buf3 = two_arguments(argument, buf1, buf2); two_arguments(argument, buf1, buf2);
if (!*buf1) { if (!*buf1) {
send_to_char(ch, "Specify a mobile VNUM to edit.\r\n"); send_to_char(ch, "Specify a mobile VNUM to edit.\r\n");

View File

@@ -75,7 +75,7 @@ void load_messages(void)
FILE *fl; FILE *fl;
int i, type; int i, type;
struct message_type *messages; struct message_type *messages;
char chk[128], *buf; char chk[128];
if (!(fl = fopen(MESS_FILE, "r"))) { if (!(fl = fopen(MESS_FILE, "r"))) {
log("SYSERR: Error reading combat message file %s: %s", MESS_FILE, strerror(errno)); log("SYSERR: Error reading combat message file %s: %s", MESS_FILE, strerror(errno));
@@ -89,12 +89,12 @@ void load_messages(void)
} }
while (!feof(fl)) { while (!feof(fl)) {
buf = fgets(chk, 128, fl); fgets(chk, 128, fl);
while (!feof(fl) && (*chk == '\n' || *chk == '*')) while (!feof(fl) && (*chk == '\n' || *chk == '*'))
buf = fgets(chk, 128, fl); fgets(chk, 128, fl);
while (*chk == 'M') { while (*chk == 'M') {
buf = fgets(chk, 128, fl); fgets(chk, 128, fl);
sscanf(chk, " %d\n", &type); sscanf(chk, " %d\n", &type);
for (i = 0; (i < MAX_MESSAGES) && (fight_messages[i].a_type != type) && for (i = 0; (i < MAX_MESSAGES) && (fight_messages[i].a_type != type) &&
(fight_messages[i].a_type); i++); (fight_messages[i].a_type); i++);
@@ -120,9 +120,9 @@ void load_messages(void)
messages->god_msg.attacker_msg = fread_action(fl, i); messages->god_msg.attacker_msg = fread_action(fl, i);
messages->god_msg.victim_msg = fread_action(fl, i); messages->god_msg.victim_msg = fread_action(fl, i);
messages->god_msg.room_msg = fread_action(fl, i); messages->god_msg.room_msg = fread_action(fl, i);
buf = fgets(chk, 128, fl); fgets(chk, 128, fl);
while (!feof(fl) && (*chk == '\n' || *chk == '*')) while (!feof(fl) && (*chk == '\n' || *chk == '*'))
buf = fgets(chk, 128, fl); fgets(chk, 128, fl);
} }
} }
fclose(fl); fclose(fl);
@@ -145,7 +145,7 @@ static void show_messages(struct char_data *ch)
len += snprintf(buf + len, sizeof(buf) - len, "%-2d) [%-3d] %d, %-18s\r\n", half, fight_messages[half].a_type, fight_messages[half].number_of_attacks, fight_messages[half].a_type < TOP_SPELL_DEFINE ? spell_info[fight_messages[half].a_type].name : "Unknown"); len += snprintf(buf + len, sizeof(buf) - len, "%-2d) [%-3d] %d, %-18s\r\n", half, fight_messages[half].a_type, fight_messages[half].number_of_attacks, fight_messages[half].a_type < TOP_SPELL_DEFINE ? spell_info[fight_messages[half].a_type].name : "Unknown");
} }
len += snprintf(buf + len, sizeof(buf) - len, "Total Messages: %d\r\n", count); snprintf(buf + len, sizeof(buf) - len, "Total Messages: %d\r\n", count);
page_string(ch->desc, buf, TRUE); page_string(ch->desc, buf, TRUE);
} }

View File

@@ -54,7 +54,6 @@ void init_events(void)
EVENTFUNC(event_countdown) EVENTFUNC(event_countdown)
{ {
struct mud_event_data * pMudEvent; struct mud_event_data * pMudEvent;
struct char_data * ch = NULL;
struct room_data * room = NULL; struct room_data * room = NULL;
room_rnum rnum = NOWHERE; room_rnum rnum = NOWHERE;
@@ -62,14 +61,13 @@ EVENTFUNC(event_countdown)
switch (mud_event_index[pMudEvent->iId].iEvent_Type) { switch (mud_event_index[pMudEvent->iId].iEvent_Type) {
case EVENT_CHAR: case EVENT_CHAR:
ch = (struct char_data * ) pMudEvent->pStruct; break;
break;
case EVENT_ROOM: case EVENT_ROOM:
room = (struct room_data * ) pMudEvent->pStruct; room = (struct room_data * ) pMudEvent->pStruct;
rnum = real_room(room->number); rnum = real_room(room->number);
break; break;
default: default:
break; break;
} }
switch (pMudEvent->iId) { switch (pMudEvent->iId) {

View File

@@ -830,7 +830,6 @@ void print_zone(struct char_data *ch, zone_vnum vnum)
size_mobiles = 0; size_mobiles = 0;
size_shops = 0; size_shops = 0;
size_trigs = 0; size_trigs = 0;
size_quests = 0;
top = zone_table[rnum].top; top = zone_table[rnum].top;
bottom = zone_table[rnum].bot; bottom = zone_table[rnum].bot;

View File

@@ -53,7 +53,6 @@ ACMD(do_oasis_oedit)
{ {
int number = NOWHERE, save = 0, real_num; int number = NOWHERE, save = 0, real_num;
struct descriptor_data *d; struct descriptor_data *d;
char *buf3;
char buf1[MAX_STRING_LENGTH]; char buf1[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
@@ -62,7 +61,7 @@ ACMD(do_oasis_oedit)
return; return;
/* Parse any arguments. */ /* Parse any arguments. */
buf3 = two_arguments(argument, buf1, buf2); two_arguments(argument, buf1, buf2);
/* If there aren't any arguments they can't modify anything. */ /* If there aren't any arguments they can't modify anything. */
if (!*buf1) { if (!*buf1) {

View File

@@ -911,7 +911,6 @@ ACMD(do_oasis_prefedit)
{ {
struct descriptor_data *d; struct descriptor_data *d;
struct char_data *vict; struct char_data *vict;
char *buf3;
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
char buf1[MAX_STRING_LENGTH]; char buf1[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
@@ -919,7 +918,7 @@ ACMD(do_oasis_prefedit)
/****************************************************************************/ /****************************************************************************/
/** Parse any arguments. **/ /** Parse any arguments. **/
/****************************************************************************/ /****************************************************************************/
buf3 = two_arguments(argument, buf1, buf2); two_arguments(argument, buf1, buf2);
/****************************************************************************/ /****************************************************************************/
/** If there aren't any arguments...well...they can only modify their **/ /** If there aren't any arguments...well...they can only modify their **/

View File

@@ -1530,7 +1530,6 @@ static void Negotiate( descriptor_t *apDescriptor )
static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProtocol ) static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProtocol )
{ {
bool_t bResult = true;
protocol_t *pProtocol = apDescriptor->pProtocol; protocol_t *pProtocol = apDescriptor->pProtocol;
switch ( aProtocol ) switch ( aProtocol )
@@ -1559,8 +1558,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
Negotiate(apDescriptor); Negotiate(apDescriptor);
} }
} }
else /* Anything else is invalid. */
bResult = false;
break; break;
case (char)TELOPT_NAWS: case (char)TELOPT_NAWS:
@@ -1568,8 +1565,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
pProtocol->bNAWS = true; pProtocol->bNAWS = true;
else if ( aCmd == (char)WONT ) else if ( aCmd == (char)WONT )
pProtocol->bNAWS = false; pProtocol->bNAWS = false;
else /* Anything else is invalid. */
bResult = false;
break; break;
case (char)TELOPT_CHARSET: case (char)TELOPT_CHARSET:
@@ -1581,8 +1576,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
} }
else if ( aCmd == (char)WONT ) else if ( aCmd == (char)WONT )
pProtocol->bCHARSET = false; pProtocol->bCHARSET = false;
else /* Anything else is invalid. */
bResult = false;
break; break;
case (char)TELOPT_MSDP: case (char)TELOPT_MSDP:
@@ -1595,8 +1588,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
} }
else if ( aCmd == (char)DONT ) else if ( aCmd == (char)DONT )
pProtocol->bMSDP = false; pProtocol->bMSDP = false;
else /* Anything else is invalid. */
bResult = false;
break; break;
case (char)TELOPT_MSSP: case (char)TELOPT_MSSP:
@@ -1604,8 +1595,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
SendMSSP( apDescriptor ); SendMSSP( apDescriptor );
else if ( aCmd == (char)DONT ) else if ( aCmd == (char)DONT )
; /* Do nothing. */ ; /* Do nothing. */
else /* Anything else is invalid. */
bResult = false;
break; break;
case (char)TELOPT_MCCP: case (char)TELOPT_MCCP:
@@ -1619,8 +1608,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
pProtocol->bMCCP = false; pProtocol->bMCCP = false;
CompressEnd( apDescriptor ); CompressEnd( apDescriptor );
} }
else // Anything else is invalid.
bResult = false;
break; break;
case (char)TELOPT_MSP: case (char)TELOPT_MSP:
@@ -1628,8 +1615,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
pProtocol->bMSP = true; pProtocol->bMSP = true;
else if ( aCmd == (char)DONT ) else if ( aCmd == (char)DONT )
pProtocol->bMSP = false; pProtocol->bMSP = false;
else /* Anything else is invalid. */
bResult = false;
break; break;
case (char)TELOPT_MXP: case (char)TELOPT_MXP:
@@ -1665,8 +1650,6 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
} }
else if ( aCmd == (char)DONT ) else if ( aCmd == (char)DONT )
pProtocol->bMXP = false; pProtocol->bMXP = false;
else /* Anything else is invalid. */
bResult = false;
break; break;
case (char)TELOPT_ATCP: case (char)TELOPT_ATCP:
@@ -1692,12 +1675,10 @@ static void PerformHandshake( descriptor_t *apDescriptor, char aCmd, char aProto
} }
else if ( aCmd == (char)WONT ) else if ( aCmd == (char)WONT )
pProtocol->bATCP = false; pProtocol->bATCP = false;
else /* Anything else is invalid. */
bResult = false;
break; break;
default: default:
bResult = false; break;
} }
} }

View File

@@ -55,14 +55,13 @@ ACMD(do_oasis_qedit)
int number = NOWHERE, save = 0; int number = NOWHERE, save = 0;
qst_rnum real_num; qst_rnum real_num;
struct descriptor_data *d; struct descriptor_data *d;
char *buf3;
char buf1[MAX_INPUT_LENGTH]; char buf1[MAX_INPUT_LENGTH];
char buf2[MAX_INPUT_LENGTH]; char buf2[MAX_INPUT_LENGTH];
/****************************************************************************/ /****************************************************************************/
/** Parse any arguments. **/ /** Parse any arguments. **/
/****************************************************************************/ /****************************************************************************/
buf3 = two_arguments(argument, buf1, buf2); two_arguments(argument, buf1, buf2);
if (!*buf1) { if (!*buf1) {
send_to_char(ch, "Specify a quest VNUM to edit.\r\n"); send_to_char(ch, "Specify a quest VNUM to edit.\r\n");

View File

@@ -34,7 +34,6 @@ static void redit_disp_menu(struct descriptor_data *d);
/* Utils and exported functions. */ /* Utils and exported functions. */
ACMD(do_oasis_redit) ACMD(do_oasis_redit)
{ {
char *buf3;
char buf1[MAX_STRING_LENGTH]; char buf1[MAX_STRING_LENGTH];
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
int number = NOWHERE, save = 0, real_num; int number = NOWHERE, save = 0, real_num;
@@ -45,7 +44,7 @@ ACMD(do_oasis_redit)
return; return;
/* Parse any arguments. */ /* Parse any arguments. */
buf3 = two_arguments(argument, buf1, buf2); two_arguments(argument, buf1, buf2);
if (!*buf1) if (!*buf1)
number = GET_ROOM_VNUM(IN_ROOM(ch)); number = GET_ROOM_VNUM(IN_ROOM(ch));

View File

@@ -50,7 +50,6 @@ ACMD(do_oasis_sedit)
int number = NOWHERE, save = 0; int number = NOWHERE, save = 0;
shop_rnum real_num; shop_rnum real_num;
struct descriptor_data *d; struct descriptor_data *d;
char *buf3;
char buf1[MAX_INPUT_LENGTH]; char buf1[MAX_INPUT_LENGTH];
char buf2[MAX_INPUT_LENGTH]; char buf2[MAX_INPUT_LENGTH];
@@ -59,7 +58,7 @@ ACMD(do_oasis_sedit)
return; return;
/* Parse any arguments. */ /* Parse any arguments. */
buf3 = two_arguments(argument, buf1, buf2); two_arguments(argument, buf1, buf2);
if (!*buf1) { if (!*buf1) {
send_to_char(ch, "Specify a shop VNUM to edit.\r\n"); send_to_char(ch, "Specify a shop VNUM to edit.\r\n");
@@ -682,7 +681,6 @@ void sedit_parse(struct descriptor_data *d, char *arg)
/* Numerical responses. */ /* Numerical responses. */
case SEDIT_KEEPER: case SEDIT_KEEPER:
i = atoi(arg);
if ((i = atoi(arg)) != -1) if ((i = atoi(arg)) != -1)
if ((i = real_mobile(i)) == NOBODY) { if ((i = real_mobile(i)) == NOBODY) {
write_to_output(d, "That mobile does not exist, try again : "); write_to_output(d, "That mobile does not exist, try again : ");

View File

@@ -1083,13 +1083,13 @@ static int read_type_list(FILE *shop_f, struct shop_buy_data *list,
int new_format, int max) int new_format, int max)
{ {
int tindex, num, len = 0, error = 0; int tindex, num, len = 0, error = 0;
char *ptr, buf[MAX_STRING_LENGTH], *buf1; char *ptr, buf[MAX_STRING_LENGTH];
if (!new_format) if (!new_format)
return (read_list(shop_f, list, 0, max, LIST_TRADE)); return (read_list(shop_f, list, 0, max, LIST_TRADE));
do { do {
buf1 = fgets(buf, sizeof(buf), shop_f); fgets(buf, sizeof(buf), shop_f);
if ((ptr = strchr(buf, ';')) != NULL) if ((ptr = strchr(buf, ';')) != NULL)
*ptr = '\0'; *ptr = '\0';
else else

View File

@@ -333,9 +333,7 @@ ASPELL(spell_identify)
} }
if (GET_OBJ_VAL(obj, 3) >= 1 && len < sizeof(bitbuf)) { if (GET_OBJ_VAL(obj, 3) >= 1 && len < sizeof(bitbuf)) {
i = snprintf(bitbuf + len, sizeof(bitbuf) - len, " %s", skill_name(GET_OBJ_VAL(obj, 3))); snprintf(bitbuf + len, sizeof(bitbuf) - len, " %s", skill_name(GET_OBJ_VAL(obj, 3)));
if (i >= 0)
len += i;
} }
send_to_char(ch, "This %s casts: %s\r\n", item_types[(int) GET_OBJ_TYPE(obj)], bitbuf); send_to_char(ch, "This %s casts: %s\r\n", item_types[(int) GET_OBJ_TYPE(obj)], bitbuf);