- initialize num_sectors and sectors in handle_flash_bank_command.
authormifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 16 Dec 2007 15:55:48 +0000 (15:55 +0000)
committermifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 16 Dec 2007 15:55:48 +0000 (15:55 +0000)
(thanks to oyvind Harboe for this hint)

git-svn-id: svn://svn.berlios.de/openocd/trunk@233 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/flash.c

index 390e37ad58eb5197668fd7b96a7958b08fd6abff..6c1fbd91539a29b639f3f580e260ad8b84d4dd1e 100644 (file)
@@ -176,7 +176,9 @@ int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char
                        c->base = strtoul(args[1], NULL, 0);
                        c->size = strtoul(args[2], NULL, 0);
                        c->chip_width = strtoul(args[3], NULL, 0);
-                       c->bus_width = strtoul(args[4], NULL, 0);
+                       c->bus_width = strtoul(args[4], NULL, 0);\r
+                       c->num_sectors = 0;\r
+                       c->sectors = NULL;
                        c->next = NULL;
                        
                        if (flash_drivers[i]->flash_bank_command(cmd_ctx, cmd, args, argc, c) != ERROR_OK)