This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/17111] STRTOL(3) unexpected behavior when use '`' before number (i.e."```1") as argument of main ()


https://sourceware.org/bugzilla/show_bug.cgi?id=17111

Sergey Churayev <sergey.churayev.76 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #6 from Sergey Churayev <sergey.churayev.76 at gmail dot com> ---
Ok,

The problem relates to transfer arguments in main (), not to strtol function.

But, how about this:

I have in my program this line
str = "0x0808"; And then try to convert it to long int.

Why I got this message?

strtol() returned 0
Further characters after number: x0808

According specification:
...
If base is zero or 16, the string may then include a "0x" prefix, and the
number will be read in base 16; otherwise, a zero base is taken as 10 (decimal)
unless the next character is '0', in which case it is taken as 8 (octal).
...

Best regards,
Serg.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]