10 Nov
2025
10 Nov
'25
9:12 p.m.
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.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9399#note_121415