[flac-dev] [PATCH] for win_utf8_io.c

Janne Hyvärinen cse at sci.fi
Fri Aug 8 11:48:40 PDT 2014


Seems that I'm blind. Please excuse me.

On 8.8.2014 21:37, lvqcl wrote:
> Janne Hyvärinen wrote:
>
>> The break that patch #3 removes is there for a reason. If there is an
>> error in string conversion there's no point in continuing the operation.
>> All conversions are discarded if something failed so not exiting from
>> the loop is wasted effort.
> Here is the current code:
>
> 	ret = 0;
>
> 	for (i=0; i<wargc; i++) {
> 		if ((utf8argv[i] = utf8_from_wchar(wargv[i])) == NULL) {
> 			ret = 1;
> 			break;
> 		}
> 		if (ret != 0) break;
> 	}
>
> I cannot see how the second break can happen.
> If utf8argv[i] != NULL then ret == 0; if utf8argv[i] == NULL then the first
> break exits the for(i=...) loop.
> _______________________________________________
> flac-dev mailing list
> flac-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/flac-dev



More information about the flac-dev mailing list