Change implementation of string splitting to support zero-length components 32/122832/2
authorRafal Krypa <r.krypa@samsung.com>
Mon, 3 Apr 2017 10:56:58 +0000 (12:56 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Mon, 3 Apr 2017 18:54:23 +0000 (20:54 +0200)
commite41ccbdc6f7ddf9ea0ea93beb8f2c09af33a6960
treeef55ccbf3a9631053d81e2f56a8a95f5006830ee
parent447e87a30f9d0f761f3e48d6eb56f382f850c0e4
Change implementation of string splitting to support zero-length components

Previous code responsible from splitting a space-separated string used
stringstream for this purpose. If one of the components used to create such
string was empty, it resulted in two consecutive spaces that were "swallowed"
by stringstream.

Now the string is parsed using std::string::find method to manually detect
locations of delimiting spaces and cut the string to pieces.

Change-Id: I2aa964716f0d41f13807bbef5c8aab6c55715a34
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
src/common/protocol/channel.cpp
src/common/protocol/channel.h