Fixed lock-up issue when input argument is wrong with -c command
authorJihoon Chung <jihoon.chung@samsung.com>
Thu, 25 Apr 2013 11:41:37 +0000 (20:41 +0900)
committerGerrit Code Review <gerrit2@kim11>
Sat, 27 Apr 2013 13:01:35 +0000 (22:01 +0900)
[Issue#] N/A
[Problem] If arguments for "-c" is wrong, wrt-installer doesn't
exit
[Cause] During parsing command, wrt-installer cannot get out from
while loop
[Solution] Add condition for argument is wrong case
[SCMRequest] N/A

Change-Id: Id506bbce99f5559bdc3d5f08716eec304287a6e5

src/wrt-installer/wrt-installer.cpp

index a61a96a..58db8f4 100644 (file)
@@ -1001,14 +1001,14 @@ CSCConfiguration::dataMap WrtInstaller::parseCSCConfiguration(
     const char* ptr = strtok(buf,":");
     while (ptr != NULL) {
         std::string string = ptr;
+        ptr = strtok (NULL, ":");
         size_t pos = string.find('=');
         if (pos == std::string::npos) {
             continue;
         }
         result.insert(
             CSCConfiguration::dataPair(string.substr(0, pos),
-                                        string.substr(pos+1)));
-        ptr = strtok (NULL, ":");
+                                       string.substr(pos+1)));
     }
      return result;
 }