]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/avnet/fx12mm/fx12mm.c
Fix incorrect use of getenv() before relocation
[karo-tx-uboot.git] / board / avnet / fx12mm / fx12mm.c
index e671a7bed12ff5fe6dfb7c04f3e68d0941ba13ae..c975efa395f0895598b1f599044f6fa8c57527f6 100644 (file)
 
 int checkboard(void)
 {
-       char tmp[64];
-       char *s, *e;
-       int i = getenv_f("serial", tmp, sizeof(tmp));
+       char buf[64];
+       int i;
+       int l = getenv_f("serial#", buf, sizeof(buf));
 
-       if (i < 0) {
+       if (l < 0) {
                printf("Avnet Virtex4 FX12 with no serial #");
        } else {
-               for (e = tmp; *e; ++e) {
-                       if (*e == ' ')
+               printf("Avnet Virtex4 FX12 Minimodul # ");
+               for (i = 0; i < l; ++i) {
+                       if (buf[i] == ' ')
                                break;
+                       putc(buf[i]);
                }
-               printf("Avnet Virtex4 FX12 Minimodul # ");
-               for (s = tmp; s < e; ++s)
-                       putc(*s);
        }
        putc('\n');
        return 0;