On Fri, Sep 9, 2011 at 4:29 AM, Joe Orton <[email protected]> wrote:
> On Thu, Sep 08, 2011 at 05:36:06PM -0400, Jeff Trawick wrote:
>> static apr_status_t base10_strtoff(apr_off_t *offset, const char *buf,
>>                                    char **endptr)
>> {
>>     const char *last;
>>
>>     *offset = apr_atoi64(buf);
>
> I think this needs to DTRT with a 32-bit off_t.
>
> How about this?
>
> static apr_status_t strtoff(apr_off_t *offset, const char *nptr,
>                            char **endptr, int base)
> {
>    errno = 0;
>    if (sizeof(apr_off_t) == 4) {
>        *offset = strtol(nptr, endptr, base);
>    }
>    else {
>        *offset = apr_strtoi64(ptr, endptr, base);
>    }
>    return APR_FROM_OS_ERROR(errno);
> }

works for me

http://people.apache.org/~trawick/draft3-2.0.64-byterange-fixes.txt

Thanks!

Reply via email to