Change-Id: Ifbecefe45d72686adef70f0b019a2d8d3b6e51fc
Signed-off-by: JinWang An <jinwang.an@samsung.com>
_sqlite_close();
return VCONF_ERROR;
}
+ sqlite3_finalize(stmt);
}
#endif
+ _sqlite_close();
return VCONF_OK;
}
sqlite3_column_text(stmt, 2));
str = (char*)malloc(MAX_BUF_LEN + 1);
+ if (NULL == str) {
+ ERR("malloc(%d) Fail()", MAX_BUF_LEN + 1);
+ sqlite3_finalize(stmt);
+ _sqlite_close();
+ return NULL;
+ }
+
strncpy(str, (char*)sqlite3_column_text(stmt, 2), MAX_BUF_LEN);
sqlite3_finalize(stmt);
+ _sqlite_close();
DBG("vconf get: key[%s], value[%s]", in_key, str);
return str;
SYSTEM_SETTINGS_FONT_SIZE_GIANT
};
- srand(time(NULL));
+ unsigned int next_val = time(NULL);
int size = sizeof(arr) / sizeof(arr[0]);
- int sel = rand() % size;
+ int sel = rand_r(&next_val) % size;
/* backup */
ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &backup);