]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - cmd/nvedit.c
Remove CONFIG_SYS_BOOTCOUNT_SINGLEWORD
[people/ms/u-boot.git] / cmd / nvedit.c
index 4e79d03856fec3117e6614c8b544c5022531562a..4cb25b824865f9aad6da83b5f63ee9312b3d8b4d 100644 (file)
@@ -650,12 +650,14 @@ char *env_get(const char *name)
  */
 int env_get_f(const char *name, char *buf, unsigned len)
 {
-       int i, nxt;
+       int i, nxt, c;
 
        for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
                int val, n;
 
-               for (nxt = i; env_get_char(nxt) != '\0'; ++nxt) {
+               for (nxt = i; (c = env_get_char(nxt)) != '\0'; ++nxt) {
+                       if (c < 0)
+                               return c;
                        if (nxt >= CONFIG_ENV_SIZE)
                                return -1;
                }
@@ -666,7 +668,10 @@ int env_get_f(const char *name, char *buf, unsigned len)
 
                /* found; copy out */
                for (n = 0; n < len; ++n, ++buf) {
-                       *buf = env_get_char(val++);
+                       c = env_get_char(val++);
+                       if (c < 0)
+                               return c;
+                       *buf = c;
                        if (*buf == '\0')
                                return n;
                }
@@ -708,10 +713,6 @@ ulong env_get_ulong(const char *name, int base, ulong default_val)
 static int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc,
                       char * const argv[])
 {
-       struct env_driver *env = env_driver_lookup_default();
-
-       printf("Saving Environment to %s...\n", env->name);
-
        return env_save() ? 1 : 0;
 }