if (!dwordp) return NULL;
/* Allow for ddddd and 0xhhhhh and 0ooooo */
if (strncmp(val, "0x", 2) == 0 || strncmp(val, "0X", 2) == 0) {
- sscanf(val, "0[xX]%X", dwordp);
+ sscanf(&val[2], "%X", dwordp);
}
else if (*val == '0') {
- sscanf(val, "0%o", dwordp);
+ sscanf(&val[1], "%o", dwordp);
}
else {
sscanf(val, "%d", dwordp);
assert(type != REG_TYPE_DELETE); /* We never process deletes here */
for (i = 0; i < key->values->val_count; i++) {
- if (strcmp(name, key->values->vals[i]->name) == 0){ /* Change the value */
+ if ((!key->values->vals[i]->has_name && !*name) ||
+ (key->values->vals[i]->has_name &&
+ strcmp(name, key->values->vals[i]->name) == 0)){ /* Change the value */
free(key->values->vals[i]->data_blk);
key->values->vals[i]->data_blk = str_to_val(type, value, &
key->values->vals[i]->data_len);
if (reg_val) nt_delete_val_key(reg_val);
}
else {
- reg_val = nt_add_reg_value(tmp, reg_val->name, val->type,
+ reg_val = nt_add_reg_value(tmp, val->name, val->type,
val->val);
}