Esme Povirk (@madewokherd) commented about dlls/sane.ds/ui.c:
- opt_order = (int *) malloc((optcount+1) * sizeof(int));
- if (!opt_order)
- {
ERR("Out of memory allocation opt_order\n");return FALSE;- }
- for ( o = 0; o < optcount; o++)
- {
opt_order[o] = o;- }
- for ( o = 1; o < optcount; o++) { struct option_descriptor opt;
opt.optno = o;
I think we should use `opt.optno = opt_order[o]` here, so that we can reuse this loop if we need more special cases.