diff options
author | Serguei Katkov <serguei.i.katkov@intel.com> | 2014-10-29 19:38:01 +0600 |
---|---|---|
committer | Serguei Katkov <serguei.i.katkov@intel.com> | 2014-11-05 13:39:43 +0600 |
commit | 62bb385728121b456782d205f6e27d0c18be9c0b (patch) | |
tree | e9507a3a1ec6a83dc7e84be9715b633b4a1c8135 | |
parent | cb8a9fcc56288378d05d80c55396db7981e3828d (diff) | |
download | frameworks_native-62bb385728121b456782d205f6e27d0c18be9c0b.tar.gz frameworks_native-62bb385728121b456782d205f6e27d0c18be9c0b.tar.bz2 frameworks_native-62bb385728121b456782d205f6e27d0c18be9c0b.zip |
Fix installd command line parser
Parser does not take into account that the last argument can be empty.
In this case it will skip end of line marker and continue parsing.
Change-Id: I2d029a69ed22cef497893e592ff3275ced97f85f
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
-rw-r--r-- | cmds/installd/installd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index b54d56cef..ca69fffcb 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -243,7 +243,9 @@ static int execute(int s, char cmd[BUFFER_MAX]) goto done; } } - cmd++; + if (*cmd) { + cmd++; + } } for (i = 0; i < sizeof(cmds) / sizeof(cmds[0]); i++) { |