summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index 66ab4eb95f..2387eb25d8 100644
--- a/player/command.c
+++ b/player/command.c
@@ -4511,7 +4511,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
char *sep = strchr(name, '/');
char *target = NULL;
char space[MAX_CLIENT_NAME];
- if (name) {
+ if (sep) {
snprintf(space, sizeof(space), "%.*s", (int)(sep - name), name);
target = space;
name = sep + 1;