{
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
{
- image->sections[j].size = field32(elf, elf->segments[i].p_memsz);
+ image->sections[j].size = field32(elf, elf->segments[i].p_filesz);
image->sections[j].base_address = field32(elf, elf->segments[i].p_paddr);
image->sections[j].private = &elf->segments[i];
image->sections[j].flags = field32(elf, elf->segments[i].p_flags);
}
+
size, &checksum)) == ERROR_TARGET_RESOURCE_NOT_AVAILABLE)
{
buffer = malloc(size);
- if (buffer==NULL)
+ if (buffer == NULL)
{
ERROR("error allocating buffer for section (%d bytes)", size);
return ERROR_OK;
for (i = 0; i < image.num_sections; i++)
{
buffer = malloc(image.sections[i].size);
- if (buffer==NULL)
+ if (buffer == NULL)
{
command_print(cmd_ctx, "error allocating buffer for section (%d bytes)", image.sections[i].size);
break;