World clock: Passing invalid pointer fixed. 49/91449/3
authorRadoslaw Czerski <r.czerski@samsung.com>
Fri, 7 Oct 2016 13:24:13 +0000 (15:24 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Tue, 11 Oct 2016 13:44:12 +0000 (06:44 -0700)
Change-Id: Idd33e42312d570b9a02790f2326819842da06727
Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
clock/src/Model/WorldClock.cpp

index 6c6d1b2..03e081d 100644 (file)
@@ -301,29 +301,30 @@ void WorldClock::LoadItemsList()
        }
 }
 
-
 const char *WorldClock::GetItemKey(int type, int no)
 {
-       static std::stringstream ss;
-       ss.clear();
+       static std::string s;
+       s.clear();
 
-       ss << "ITEM_" << no << "_";
+       s.append("ITEM_");
+       s.append(std::to_string(no));
+       s.append("_");
        switch (type) {
                case CITY:
-                       ss << "CITY";
+                       s.append("CITY");
                        break;
                case COUNTRY:
-                       ss << "COUNTRY";
+                       s.append("COUNTRY");
                        break;
                case OFFSET:
-                       ss << "OFFSET";
+                       s.append("OFFSET");
                        break;
                default:
                        ERR("Invalid type!");
                        return NULL;
        }
 
-       return ss.str().c_str();
+       return s.c_str();
 }
 
 void WorldClock::SaveItem(const model::Location *item, int i)