mirror of
https://github.com/tbamud/tbamud.git
synced 2026-01-10 03:18:50 +01:00
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:
parent
5dc6eae4c5
commit
68fcdb73bf
9 changed files with 18 additions and 19 deletions
|
|
@ -1193,7 +1193,7 @@ ACMD(do_detach)
|
|||
}
|
||||
}
|
||||
|
||||
if (arg3 == NULL || !*arg3)
|
||||
if (!*arg3)
|
||||
send_to_char(ch, "You must specify a trigger to remove.\r\n");
|
||||
else
|
||||
trigger = arg3;
|
||||
|
|
@ -1218,7 +1218,7 @@ ACMD(do_detach)
|
|||
}
|
||||
}
|
||||
|
||||
if (arg3 == NULL || !*arg3)
|
||||
if (!*arg3)
|
||||
send_to_char(ch, "You must specify a trigger to remove.\r\n");
|
||||
else
|
||||
trigger = arg3;
|
||||
|
|
@ -1957,7 +1957,7 @@ static void makeuid_var(void *go, struct script_data *sc, trig_data *trig,
|
|||
return;
|
||||
}
|
||||
|
||||
if (arg == NULL || !*arg) {
|
||||
if (!*arg) {
|
||||
script_log("Trigger: %s, VNum %d. makeuid invalid id arg: '%s'",
|
||||
GET_TRIG_NAME(trig), GET_TRIG_VNUM(trig), cmd);
|
||||
return;
|
||||
|
|
@ -1969,7 +1969,7 @@ static void makeuid_var(void *go, struct script_data *sc, trig_data *trig,
|
|||
eval_expr(arg, result, go, sc, trig, type);
|
||||
snprintf(uid, sizeof(uid), "%c%s", UID_CHAR, result);
|
||||
} else { /* a lot more work without it */
|
||||
if (name == NULL || !*name) {
|
||||
if (!*name) {
|
||||
script_log("Trigger: %s, VNum %d. makeuid needs name: '%s'",
|
||||
GET_TRIG_NAME(trig), GET_TRIG_VNUM(trig), cmd);
|
||||
return;
|
||||
|
|
@ -2242,7 +2242,7 @@ int perform_set_dg_var(struct char_data *ch, struct char_data *vict, char *val_a
|
|||
|
||||
var_value = any_one_arg(val_arg, var_name);
|
||||
|
||||
if (var_name == NULL || !*var_name || var_value == NULL || !*var_value) {
|
||||
if (!*var_name || var_value == NULL || !*var_value) {
|
||||
send_to_char(ch, "Usage: set <char> <varname> <value>\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue