aboutsummaryrefslogtreecommitdiff
path: root/regulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'regulator.c')
-rw-r--r--regulator.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/regulator.c b/regulator.c
index 55bd3e9..0da924a 100644
--- a/regulator.c
+++ b/regulator.c
@@ -90,13 +90,17 @@ static int regulator_dump_cb(struct tree *tree, void *data)
printf("\n%s:\n", tree->name);
for (i = 0; i < nregdata; i++) {
+ int val;
if (file_read_value(tree->path, regdata[i].name,
regdata[i].ifmt, buffer))
continue;
- printf(regdata[i].ofmt, regdata[i].derefme ?
- *((int *)buffer) : buffer);
+ if (regdata[i].derefme) {
+ val = atoi(buffer);
+ printf(regdata[i].ofmt, val);
+ } else
+ printf(regdata[i].ofmt, buffer);
}
return 0;