summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-22 12:21:36 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-22 13:18:52 +0300
commit7cd13920d00abbb4b19e64fa13f5ebed80c04a37 (patch)
treef3e05d8624443839de66ea99cb17abe36e7a4df8 /client
parent9e004ba689534442d8b4738d41a9cf591cd38c87 (diff)
downloadconnman-7cd13920d00abbb4b19e64fa13f5ebed80c04a37.tar.gz
connman-7cd13920d00abbb4b19e64fa13f5ebed80c04a37.tar.bz2
connman-7cd13920d00abbb4b19e64fa13f5ebed80c04a37.zip
client: Fix minor issues in D-Bus path name checking
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') ||