Re: smpp dlr problem

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
Andrea Viscovich wrote:
> 
> >atol would not work if the string is in HEX.
> 
> Well, the code from Nisan worked fine with my smsc connection,
> and I implemented this for atoll.
> Maybe under more recent cygwin it's built in.
> 
> long long atoll(char *str){
>  long long result = 0;
>  int negative=0;
> 
>  while (*str == ' ' || *str == '\t')
>   str++;
>  if (*str == '+')
>   str++;
>  else if (*str == '-') {
>   negative = 1;
>   str++;
>  }
> 
>  while (*str >= '0' && *str <= '9') {
>   result = (result*10) - (*str++ - '0');
>  }
> 
>  return negative ? result : -result;
> }

hmmm, so atoll() is not posix compliant?! at least it's *not* included
in the standard headers on Cygwin 1.3.22. :((

Nisan, isn't there a portable function to use in this case?

Stipe

[email protected]
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [email protected]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.