summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/commands.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/commands.c b/client/commands.c
index 8c67ebc6..bd33284d 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -73,10 +73,11 @@ static bool check_dbus_name(const char *name)
*/
unsigned int i;
- if (name == NULL || (name[0] >= '0' && name[0] <= '9'))
+ if (name == NULL || name[0] == '\0' || (name[0] >= '0' &&
+ name[0] <= '9'))
return false;
- for (i = 0; i < strlen(name); i++)
+ for (i = 0; name[i] != '\0'; i++)
if (!((name[i] >= 'A' && name[i] <= 'Z') ||
(name[i] >= 'a' && name[i] <= 'z') ||
(name[i] >= '0' && name[i] <= '9') ||