wined3d: fix a compiler warning
Michael Stefaniuc
mstefani at redhat.com
Wed Jun 24 03:17:22 CDT 2009
Pierre Bourdon wrote:
> On Wed, Jun 24, 2009 at 03:43, Austin English<austinenglish at gmail.com> wrote:
>> On Tue, Jun 23, 2009 at 3:58 AM, Michael Stefaniuc<mstefani at redhat.de> wrote:
>>> Hello Austin,
>>>
>>> are you reinventing strcpy?
>> We do this elsewhere throughout the source. It prevents possible
>> crashes/security vulnerabilities, as well as this warning:
>> arb_program_shader.c: In function ‘shader_arb_get_register_name’:
>> arb_program_shader.c:931: warning: format not a string literal and no
>> format arguments
>> arb_program_shader.c:935: warning: format not a string literal and no
>> format arguments
>>
>> --
>> -Austin
>
> I think what Michael meant is that
> sprintf(a, "%s", b);
>
> is doing exactly the same thing as
> strcpy(a, b);
Right, that's what I meant.
> in a less efficient way.
I'm not that much concerned about efficiency as the compiler will
optimize it. But a strcpy is definitely easier to read.
bye
michael
More information about the wine-devel
mailing list