aboutsummaryrefslogtreecommitdiff
path: root/board/ml2
diff options
context:
space:
mode:
Diffstat (limited to 'board/ml2')
-rw-r--r--board/ml2/ml2.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/board/ml2/ml2.c b/board/ml2/ml2.c
index 981e1decd..319dca09d 100644
--- a/board/ml2/ml2.c
+++ b/board/ml2/ml2.c
@@ -30,23 +30,19 @@ int board_early_init_f (void)
int checkboard (void)
{
- char *s = getenv ("serial#");
- char *e;
+ char buf[64];
+ int i;
+ int l = getenv_f("serial#", buf, sizeof(buf));
- if (!s || strncmp (s, "ML2", 9)) {
+ if (l < 0 || strncmp(buf, "ML2", 9)) {
printf ("### No HW ID - assuming ML2");
} 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]);
}
}
-
-
putc ('\n');
return (0);