On Sunday 20 September 2009, Johnny Halfmoon wrote:
> +               if ((retval = flash_check_sector_parameters(cmd_ctx, first, 
> last, p->num_sectors)) !

I had in mind more like

        uint32_t value;

        retval = parse_u32(argv[X], &value);
        if (retval != ERROR_OK)
                return retval;

to replace the various unchecked

        int value = strtoul(argv[X]);

statements.  That would cover the cases where the string was
not "last" (or "first"?) but was a broken number string.

You're right that there are _additional_ error cases to cope
with too ... you seem to have had your eyes on some different
failures in error checking than I did!  :)

How about updating your patch to swap out strtoul() calls
like that, so both sets of errors get checked?

You would be able to get rid of those check for negative
numbers that way, too.

- Dave

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to