[PATCH] cryptui: Avoid calling strlen on a constant.

Alexandre Julliard julliard at winehq.org
Tue Feb 5 12:26:00 CST 2019


Michael Stefaniuc <mstefani at winehq.org> writes:

> On 2/5/19 9:02 AM, Isira Seneviratne wrote:
>> 
>> 
>> On Tue, Feb 5, 2019 at 1:26 PM Nikolay Sivov <nsivov at codeweavers.com
>> <mailto:nsivov at codeweavers.com>> wrote:
>> 
>>     I don't think hardcoded sizes like that are better, because you'll
>>     always need to double check with actual string.
>> 
>> What is there to double check, though? It seems to be fairly straight
>> forward.
> Magic constants are bad, one has to follow the code flow to figure it
> out. Afair we even had a janitorial task to remove magic constants.
>
> If you still want to get rid of the strlen do it like Alex Henri did and
> use: ARRAY_SIZE(wstr) - 1.

Frankly, keeping strlen() is fine. At least it's not worth doing a large
scale search & replace job for this (much to your dismay I'm sure...)

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list