[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] remove svn__strtol() and svn__strtoul()

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 6 Aug 2014 17:57:19 +0200

On Wed, Aug 06, 2014 at 07:31:04PM +0400, Ivan Zhakov wrote:
> apr_get_os_error() uses GetLastError() on Windows, while strtol() uses
> standard errno for error code.

So you're saying code like this works on Windows, and I shouldn't
be using apr_get/set_os_error() for strtol()?

           errno = 0;
           lval = strtol(buf, &ep, 10);
           if (buf[0] == '\0' || *ep != '\0')
                goto not_a_number;
           if ((errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN)) ||
               (lval > INT_MAX || lval < INT_MIN))
                goto out_of_range;
           ival = lval;
Received on 2014-08-06 17:57:54 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.