Fix some issues 11/210511/1
authormk5004.lee <mk5004.lee@samsung.com>
Mon, 22 Jul 2019 04:55:44 +0000 (13:55 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Mon, 22 Jul 2019 04:55:44 +0000 (13:55 +0900)
- unreachable dead code
  unchecked retrun value

Change-Id: Icfea04af4b96057aaea92f18dc6f2759c7c38f2c
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
parser/complication_parser_plugin.cc
watchface-complication/db-manager.cc

index 3a6090e..759feff 100644 (file)
@@ -366,7 +366,6 @@ static string _make_raw_default_data(xmlNode* node, int support_type) {
     LOGE("Exception (%s)", e.what());
     return "";
   }
-  return "";
 }
 
 static int _insert_parsed_data(sqlite3* db, sqlite3_stmt* stmt, xmlNode* node,
index b679be3..d3f56b7 100644 (file)
@@ -537,8 +537,10 @@ std::string DBManager::GetLabel(const char* provider_id) {
     sqlite3_reset(db.GetCursor().get());
     sqlite3_clear_bindings(db.GetCursor().get());
 
-    db.Bind(1, provider_id);
-    db.Bind(2, DEFAULT_LOCALE);
+    if (!db.Bind(1, provider_id))
+      return std::string();
+    if (!db.Bind(2, DEFAULT_LOCALE))
+      return std::string();
 
     if (db.Step() == SQLITE_ROW) {
       const char* lb = db.GetText(0);