Fix incorrect use of getenv() before relocation
[oweals/u-boot.git] / board / digsy_mtc / digsy_mtc.c
index 9f13a3d1070fb946f82a106e2b579a99ef614b16..588facefef409acfa53acdb8b8be7d04121338b5 100644 (file)
@@ -191,15 +191,16 @@ phys_size_t initdram(int board_type)
 
 int checkboard(void)
 {
-       char *s = getenv("serial#");
+       char buf[64];
+       int i = getenv_f("serial#", buf, sizeof(buf));
 
        puts ("Board: InterControl digsyMTC");
 #if defined(CONFIG_DIGSY_REV5)
        puts (" rev5");
 #endif
-       if (s != NULL) {
+       if (i > 0) {
                puts(", ");
-               puts(s);
+               puts(buf);
        }
        putc('\n');