summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-22 09:21:36 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-22 10:18:52 (GMT)
commit7cd13920d00abbb4b19e64fa13f5ebed80c04a37 (patch)
treef3e05d8624443839de66ea99cb17abe36e7a4df8 /client
parent9e004ba689534442d8b4738d41a9cf591cd38c87 (diff)
downloadconnman-7cd13920d00abbb4b19e64fa13f5ebed80c04a37.zip
connman-7cd13920d00abbb4b19e64fa13f5ebed80c04a37.tar.gz
connman-7cd13920d00abbb4b19e64fa13f5ebed80c04a37.tar.bz2
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 8c67ebc..bd33284 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') ||