Code cleanups

This commit is contained in:
topjohnwu
2018-10-04 01:49:52 -04:00
parent 6a06c92fa6
commit 09ef19f7ec
7 changed files with 55 additions and 59 deletions

View File

@ -869,7 +869,7 @@ core_only:
// Check whether we have a valid manager installed
sqlite3 *db = get_magiskdb();
struct db_strings str;
INIT_DB_STRINGS(&str);
memset(&str, 0, sizeof(str));
get_db_strings(db, SU_MANAGER, &str);
if (validate_manager(str.s[SU_MANAGER], 0, NULL)) {
// There is no manager installed, install the stub

View File

@ -8,11 +8,6 @@
#include "magisk.h"
#include "db.h"
void INIT_DB_STRINGS(struct db_strings *str) {
for (int i = 0; i < DB_STRING_NUM; ++i)
str->s[i][0] = '\0';
}
static int policy_cb(void *v, int col_num, char **data, char **col_name) {
struct su_access *su = v;
for (int i = 0; i < col_num; i++) {