]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/env.c
New debug command: dump heap
[z180-stamp.git] / avr / env.c
index 39effac509419425b9fdd4c10b4c6fac94d26e97..3b299c4b9cb18e99d0a828dc9ceb070b983910f2 100644 (file)
--- a/avr/env.c
+++ b/avr/env.c
@@ -4,18 +4,12 @@
  * SPDX-License-Identifier:    GPL-2.0
  */
 
-#include "common.h"
-#include <string.h>
-#include <stdlib.h>
-#include <stdbool.h>
+#include "env.h"
 #include <avr/eeprom.h>
 
 #include "config.h"
 #include "debug.h"
-#include "xmalloc.h"
 #include "crc.h"
-#include "command.h"
-#include "env.h"
 
 
 #define ENV_SIZE       (CONFIG_ENV_SIZE - sizeof(uint16_t) -1)
@@ -199,7 +193,7 @@ int envlist_import(uint8_t flags)
                                return -1;
                }
 
-               np = (char *) xmalloc(len+1);
+               np = (char *) malloc(len+1);
                if (np == NULL) {
                        printf_P(PSTR("## Can't malloc %d bytes\n"), len+1);
                        return 1;
@@ -488,7 +482,7 @@ command_ret_t _do_env_set(uint_fast8_t flag, int argc, char * const argv[])
        for (i = 2, len += 1; i < argc; ++i)
                len += strlen(argv[i]) + 1;
 
-       value = xmalloc(len);
+       value = malloc(len);
        if (value == NULL) {
                printf_P(PSTR("## Can't malloc %d bytes\n"), len);
                return CMD_RET_FAILURE;