Prevent compiler warnings and potential OLC setting string truncation.

- Prevented compiler warnings when using
’-Wtautological-pointer-compare’ on development system (Darwin)
- Prevented possible string truncation when adding a newline to an OLC
setting string.
This commit is contained in:
WyldTBA 2015-04-23 08:49:48 -04:00
parent 5dc6eae4c5
commit 68fcdb73bf
9 changed files with 18 additions and 19 deletions

View file

@ -385,9 +385,9 @@ ACMD(do_mload)
return;
}
two_arguments(target, arg1, arg2); /* recycling ... */
tch = (arg1 != NULL && *arg1 == UID_CHAR) ? get_char(arg1) : get_char_room_vis(ch, arg1, NULL);
tch = (*arg1 == UID_CHAR) ? get_char(arg1) : get_char_room_vis(ch, arg1, NULL);
if (tch) {
if (arg2 != NULL && *arg2 && (pos = find_eq_pos_script(arg2)) >= 0 &&
if (*arg2 && (pos = find_eq_pos_script(arg2)) >= 0 &&
!GET_EQ(tch, pos) && can_wear_on_pos(object, pos)) {
equip_char(tch, object, pos);
load_otrigger(object);
@ -397,7 +397,7 @@ ACMD(do_mload)
load_otrigger(object);
return;
}
cnt = (arg1 != NULL && *arg1 == UID_CHAR) ? get_obj(arg1) : get_obj_vis(ch, arg1, NULL);
cnt = (*arg1 == UID_CHAR) ? get_obj(arg1) : get_obj_vis(ch, arg1, NULL);
if (cnt && GET_OBJ_TYPE(cnt) == ITEM_CONTAINER) {
obj_to_obj(object, cnt);
load_otrigger(object);