command_write_ram - cleanup

This commit is contained in:
twinaphex 2019-06-06 13:12:38 +02:00
parent 8bb74d0776
commit b4d2281f7d

View File

@ -324,14 +324,12 @@ static bool command_read_ram(const char *arg)
static bool command_write_ram(const char *arg)
{
unsigned nbytes = 0;
uint8_t *data = NULL;
unsigned int addr = 0;
unsigned int addr = strtoul(arg, (char**)&arg, 16);
uint8_t *data = (uint8_t *)rcheevos_patch_address(addr, rcheevos_get_console());
addr = strtoul(arg, (char**)&arg, 16);
data = (uint8_t *)rcheevos_patch_address(addr, rcheevos_get_console());
if (!data)
return false;
if (data)
{
while (*arg)
{
*data = strtoul(arg, (char**)&arg, 16);
@ -339,9 +337,6 @@ static bool command_write_ram(const char *arg)
}
return true;
}
return false;
}
#endif
#if defined(HAVE_NETWORKING) && defined(HAVE_NETWORK_CMD) && defined(HAVE_COMMAND)