command: use array index for checking first character

This commit is contained in:
nanahi 2024-11-01 12:49:46 -04:00 committed by Kacper Michajłow
parent 081fc7e317
commit c5da7beaa6
1 changed files with 2 additions and 2 deletions

View File

@ -6549,7 +6549,7 @@ static void cmd_delete_watch_later_config(void *p)
struct MPContext *mpctx = cmd->mpctx; struct MPContext *mpctx = cmd->mpctx;
char *filename = cmd->args[0].v.s; char *filename = cmd->args[0].v.s;
if (filename && !*filename) if (filename && !filename[0])
filename = NULL; filename = NULL;
mp_delete_watch_later_conf(mpctx, filename); mp_delete_watch_later_conf(mpctx, filename);
} }
@ -6629,7 +6629,7 @@ static void cmd_key_bind(void *p)
const char *key = cmd->args[0].v.s; const char *key = cmd->args[0].v.s;
const char *target_cmd = cmd->args[1].v.s; const char *target_cmd = cmd->args[1].v.s;
const char *comment = cmd->args[2].v.s; const char *comment = cmd->args[2].v.s;
if (comment && !*comment) if (comment && !comment[0])
comment = NULL; comment = NULL;
if (!mp_input_bind_key(mpctx->input, key, bstr0(target_cmd), comment)) { if (!mp_input_bind_key(mpctx->input, key, bstr0(target_cmd), comment)) {
MP_ERR(mpctx, "%s is not a valid input name.\n", key); MP_ERR(mpctx, "%s is not a valid input name.\n", key);