fernly/cmd-hex.c
Sean Cross f8991202c6 cmd: Use strtoul instead of _strtoul
The non-underscore one comes from vsprintf.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 13:12:53 +08:00

24 lines
425 B
C

#include <string.h>
#include "bionic.h"
#include "memio.h"
#include "printf.h"
#include "serial.h"
#include "utils.h"
int cmd_hex(int argc, char **argv)
{
uint32_t offset;
int count = 0x200;
if (argc < 1) {
printf("Usage: hex [offset] [[count]]\n");
return -1;
}
offset = strtoul(argv[0], NULL, 0);
if (argc > 1)
count = strtoul(argv[1], NULL, 0);
serial_print_hex((const void *)offset, count);
return 0;
}