summaryrefslogtreecommitdiffstats
path: root/sys/boot/ofw/libofw/openfirm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/ofw/libofw/openfirm.c')
-rw-r--r--sys/boot/ofw/libofw/openfirm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/boot/ofw/libofw/openfirm.c b/sys/boot/ofw/libofw/openfirm.c
index 0114fb5..d4eb9d6 100644
--- a/sys/boot/ofw/libofw/openfirm.c
+++ b/sys/boot/ofw/libofw/openfirm.c
@@ -77,7 +77,7 @@ void
OF_init(int (*openfirm)(void *))
{
phandle_t options;
- char mode[8];
+ char mode[sizeof("true")];
openfirmware = openfirm;
@@ -93,13 +93,13 @@ OF_init(int (*openfirm)(void *))
if (OF_getprop(chosen, "mmu", &mmu, sizeof(mmu)) == -1)
OF_exit();
- /*
+ /*
* Check if we run in real mode. If so, we do not need to map
* memory later on.
*/
options = OF_finddevice("/options");
- OF_getprop(options, "real-mode?", mode, sizeof(mode));
- if (strncmp(mode, "true", 4) == 0)
+ if (OF_getprop(options, "real-mode?", mode, sizeof(mode)) > 0 &&
+ strcmp(mode, "true") == 0)
real_mode = 1;
}
OpenPOWER on IntegriCloud