cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: lib/transfer.c: checkhttpprefix() assignment of value to const parameter?

From: Andre Guibert de Bruet <andy_at_siliconlandmark.com>
Date: Wed, 23 May 2007 00:24:16 -0400 (EDT)

On Tue, 22 May 2007, Dan Fandrich wrote:
> On Tue, May 22, 2007 at 11:31:22PM -0400, Andre Guibert de Bruet wrote:
>> Maybe it's late and I should get some sleep, but it appears that in
>> 7.16.2's lib/transfer.c:201, the assignment of s = scratch is invalid as s
>> is a const char * parameter to the checkhttpprefix() function. This code
>> is only in the CURL_DOES_CONVERSION case. What systems require/use this
>> #define?
>
> IBM mainframes using native EBCDIC encoding.

Noted.

>> I don't see how this source file would compile without errors on
>> such a system.
>
> It's a pointer to a constant char, not a constant pointer to a char. Since
> s is more restrictive than scratch, it's a valid assignment.

I knew that! I will try not to send late-night emails in the future. Sorry
for the noise. ;-)

Cheers,

/* Andre Guibert de Bruet * 6f43 6564 7020 656f 2e74 4220 7469 6a20 */
/* Code poet / Sysadmin * 636f 656b 2e79 5320 7379 6461 696d 2e6e */
/* GSM: +1 734 846 8758 * 5520 494e 2058 6c73 7565 6874 002e 0000 */
/* WWW: siliconlandmark.com * Tormenting bytes since 1980. */
Received on 2007-05-23