summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorho.namkoong <ho.namkoong@samsung.com>2013-11-26 11:00:31 +0900
committerho.namkoong <ho.namkoong@samsung.com>2013-11-26 11:04:06 +0900
commit1c846eb8242a426eccd03035c0fa8da514d82410 (patch)
tree6fe03d1560d59f361dcf162d82c029ebd11859ff
parent905e6d6995ac3dc086d2ec036564ee75f4d5a5e9 (diff)
downloadsdb-1c846eb8242a426eccd03035c0fa8da514d82410.tar.gz
sdb-1c846eb8242a426eccd03035c0fa8da514d82410.tar.bz2
sdb-1c846eb8242a426eccd03035c0fa8da514d82410.zip
SDB: fix service parsing bug
if serial contains ':', service string cannot be parsed normally Change-Id: Icfb13b31ea6cc6a42a895f389dfa2c8e5306f56f Signed-off-by: ho.namkoong <ho.namkoong@samsung.com>
-rwxr-xr-xsrc/sockets.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sockets.c b/src/sockets.c
index 1ef12c3..0f85310 100755
--- a/src/sockets.c
+++ b/src/sockets.c
@@ -618,6 +618,20 @@ static int parse_host_service(char* host_str, char** service_ptr, TRANSPORT** t,
*err_str = (char*)TRANSPORT_ERR_TARGET_NOT_FOUND;
return 0;
}
+
+ char* new_end = end + 1;
+ if(isdigit(*new_end)) {
+ while(1) {
+ new_end++;
+ if(!isdigit(*new_end)) {
+ if(*new_end == ':') {
+ end = new_end;
+ }
+ break;
+ }
+ }
+ }
+
*end = '\0';
*service_ptr = end + 1;
*t = acquire_one_transport(kTransportAny, serial, err_str);