diff options
author | wdenk <wdenk> | 2003-09-19 08:29:25 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-09-19 08:29:25 +0000 |
commit | 1d70468b039b6ead903c9b14fa09005476259a65 (patch) | |
tree | 97350a76b53eef9c7a471eb33f58fb12f74e3c26 | |
parent | c3d98ed9ca961fc6e22d9e28e33e0aa758eaee5b (diff) |
"start" may be legitimately 0x0000
-rw-r--r-- | board/trab/auto_update.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/board/trab/auto_update.c b/board/trab/auto_update.c index 9559d5e04e3..9371637e925 100644 --- a/board/trab/auto_update.c +++ b/board/trab/auto_update.c @@ -485,41 +485,45 @@ do_auto_update(void) * now check whether start and end are defined using environment * variables. */ - start = end = 0; + start = -1; + end = 0; env = getenv("firmware_st"); if (env != NULL) start = simple_strtoul(env, NULL, 16); env = getenv("firmware_nd"); if (env != NULL) end = simple_strtoul(env, NULL, 16); - if (start && end && end > start) + if (start >= 0 && end && end > start) ausize[IDX_FIRMWARE] = (end + 1) - start; - start = end = 0; + start = -1; + end = 0; env = getenv("kernel_st"); if (env != NULL) start = simple_strtoul(env, NULL, 16); env = getenv("kernel_nd"); if (env != NULL) end = simple_strtoul(env, NULL, 16); - if (start && end && end > start) + if (start >= 0 && end && end > start) ausize[IDX_KERNEL] = (end + 1) - start; - start = end = 0; + start = -1; + end = 0; env = getenv("app_st"); if (env != NULL) start = simple_strtoul(env, NULL, 16); env = getenv("app_nd"); if (env != NULL) end = simple_strtoul(env, NULL, 16); - if (start && end && end > start) + if (start >= 0 && end && end > start) ausize[IDX_APP] = (end + 1) - start; - start = end = 0; + start = -1; + end = 0; env = getenv("disk_st"); if (env != NULL) start = simple_strtoul(env, NULL, 16); env = getenv("disk_nd"); if (env != NULL) end = simple_strtoul(env, NULL, 16); - if (start && end && end > start) + if (start >= 0 && end && end > start) ausize[IDX_DISK] = (end + 1) - start; /* make sure that we see CTRL-C and save the old state */ old_ctrlc = disable_ctrlc(0); |