diff options
author | mifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-12-16 18:19:43 +0000 |
---|---|---|
committer | mifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-12-16 18:19:43 +0000 |
commit | f328fb8a6ce37c2af441d08d41d683d70454334a (patch) | |
tree | ba585a81a1ef2d657b50be3e3991edaae2c9a33f /src | |
parent | b642f4219916b1f7eb74ddfd91ac40c43ae85133 (diff) | |
download | openocd+libswd-f328fb8a6ce37c2af441d08d41d683d70454334a.tar.gz openocd+libswd-f328fb8a6ce37c2af441d08d41d683d70454334a.tar.bz2 openocd+libswd-f328fb8a6ce37c2af441d08d41d683d70454334a.tar.xz openocd+libswd-f328fb8a6ce37c2af441d08d41d683d70454334a.zip |
- change error message for image_open error
- changed run_size to size_read in argument of image_read_section
(thanks to oyvind Harboe for this patch)
git-svn-id: svn://svn.berlios.de/openocd/trunk@234 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/flash/flash.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c index 6c1fbd91..2271f603 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -563,11 +563,12 @@ int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cm } image.start_address_set = 0; - - if (image_open(&image, args[0], (argc == 4) ? args[2] : NULL) != ERROR_OK) +
+ retval = image_open(&image, args[0], (argc == 4) ? args[2] : NULL); + if (retval != ERROR_OK) { - command_print(cmd_ctx, "flash write error: %s", image.error_str); - return ERROR_OK; + command_print(cmd_ctx, "image_open error: %s", image.error_str); + return retval; } failed = malloc(sizeof(int) * image.num_sections); @@ -849,7 +850,7 @@ int flash_write(target_t *target, image_t *image, u32 *written, char **error_str size_read = image->sections[section].size - section_offset; if ((retval = image_read_section(image, section, section_offset, - run_size, buffer + buffer_size, &size_read)) != ERROR_OK || size_read == 0) + size_read, buffer + buffer_size, &size_read)) != ERROR_OK || size_read == 0) { free(buffer); |