Modernize code base

This commit is contained in:
topjohnwu
2018-11-07 02:10:38 -05:00
parent ca35a9681f
commit 7c12bf7fa1
21 changed files with 421 additions and 287 deletions

View File

@ -190,21 +190,21 @@ void persist_getprop(read_cb_t *read_cb) {
}
}
char *persist_getprop(const char *name) {
CharArray persist_getprop(const char *name) {
prop_t prop(name);
if (use_pb) {
read_cb_t read_cb(pb_getprop_cb, &prop);
pb_getprop(&read_cb);
if (prop.value[0])
return strdup(prop.value);
return prop.value;
} else {
// Try to read from file
char value[PROP_VALUE_MAX];
file_getprop(name, value);
if (value[0])
return strdup(value);
return value;
}
return nullptr;
return CharArray();
}
bool persist_deleteprop(const char *name) {