aboutsummaryrefslogtreecommitdiff
path: root/board/hermes/hermes.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/hermes/hermes.c')
-rw-r--r--board/hermes/hermes.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/board/hermes/hermes.c b/board/hermes/hermes.c
index 9a3e5f669..acf364e2b 100644
--- a/board/hermes/hermes.c
+++ b/board/hermes/hermes.c
@@ -107,21 +107,19 @@ const uint sdram_table[] = {
int checkboard (void)
{
- char *s = getenv ("serial#");
- char *e;
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
puts ("Board: ");
- if (!s || strncmp (s, "HERMES", 6)) {
+ if (l < 0 || strncmp(buf, "HERMES", 6)) {
puts ("### No HW ID - assuming HERMES-PRO");
} else {
- for (e = s; *e; ++e) {
- if (*e == ' ')
+ for (i = 0; i < l; i++) {
+ if (buf[i] == ' ')
break;
- }
-
- for (; s < e; ++s) {
- putc (*s);
+ putc (buf[i]);
}
}