This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for CONFIG_STRING option in RedBoot


> Index: ecos/packages/redboot/current/src/flash.c
> ===================================================================
> RCS file: /cvs/ecos/ecos/packages/redboot/current/src/flash.c,v
> retrieving revision 1.46
> diff -u -u -r1.46 flash.c
> --- ecos/packages/redboot/current/src/flash.c	14 May 2003 20:12:54 -0000	1.46
> +++ ecos/packages/redboot/current/src/flash.c	29 Jul 2003 10:27:29 -0000
> @@ -2006,7 +2006,7 @@
>  #endif
>  #endif
>      case CONFIG_STRING:
> -        memcpy(dp, (void *)opt->dflt, config_length(CONFIG_STRING));
> +        memcpy(dp, (void *)&opt->dflt, config_length(CONFIG_STRING));
>          break;
>      case CONFIG_SCRIPT:
>          break;

Could you explain this patch a bit more. As far as i can see,
opt->dflt contains the address of the string that should be used, not
the string itself. Take a look at do_alias()


    case 3:
        if (strlen(argv[2]) >= MAX_STRING_LENGTH) {
            diag_printf("Sorry, value is too long\n");
            break;
        }
        make_alias(name, argv[1]);
        opt.type = CONFIG_STRING;
        opt.enable = (char *)0;
        opt.enable_sense = 1;
        opt.key = name;
        opt.dflt = (CYG_ADDRESS)argv[2];
        flash_add_config(&opt, true);
        break;

To me your patch looks wrong, but i could be missing something here.

     Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]