]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/RRvision/RRvision.c
Fix incorrect use of getenv() before relocation
[karo-tx-uboot.git] / board / RRvision / RRvision.c
index 9d016c59d3c42a24fe5fe9ca19ec0439948f8038..0182d8a3350439269dfebeba1468550ed8a213a7 100644 (file)
@@ -93,14 +93,16 @@ const uint sdram_table[] =
 
 int checkboard (void)
 {
-       char *s = getenv ("serial#");
+       char buf[64];
+       int i;
+       int l = getenv_f("serial#", buf, sizeof(buf));
 
        puts ("Board: RRvision ");
 
-       for (; s && *s; ++s) {
-               if (*s == ' ')
+       for (i=0; i < l; ++i) {
+               if (buf[i] == ' ')
                        break;
-               putc (*s);
+               putc (buf[i]);
        }
 
        putc ('\n');