[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [Bug #2481] atoi.S and atol.S: incorrect handling of post
From: |
nobody |
Subject: |
[avr-libc-dev] [Bug #2481] atoi.S and atol.S: incorrect handling of post characters if not \0 |
Date: |
Fri, 14 Feb 2003 10:28:05 -0500 |
=================== BUG #2481: LATEST MODIFICATIONS ==================
http://savannah.nongnu.org/bugs/?func=detailbug&bug_id=2481&group_id=2140
Changes by: Reiner Patommel <address@hidden>
Date: 2003-Feb-14 15:28 (GMT)
------------------ Additional Bug Attachment ----------------------------
File name: atoi.S Size:3 KB
http://savannah.nongnu.org/bugs/download.php?group_id=2140&bug_id=2481&bug_file_id=300
=================== BUG #2481: FULL BUG SNAPSHOT ===================
Submitted by: zenker Project: AVR C Runtime Library
Submitted on: 2003-Feb-05 14:40
Category: None Severity: 5 - Major
Bug Group: None Resolution: Fixed
Assigned to: rpato Originator Email: address@hidden
Status: Open
Summary: atoi.S and atol.S: incorrect handling of post characters if not \0
Original Submission: According to the description in the header the conversion
should stop at detection of an non numeric character. But if the non numeric
character is different from \0 then
the minus sign is placed by mistake.
.
.
.
.atol_sig:
CP num_lo_lo, __zero_reg__
CPC num_lo_hi, __zero_reg__
CPC num_hi_lo, __zero_reg__
CPC num_hi_hi, __zero_reg__ ; did we get a number?
BREQ .atol_done ; no, drop sign and return
CLR tmp ; MUST be set to 0 else
; there would be a
; misinterpretation if
; the last Char isn't "\0"
BLD tmp, 0 ; get sign again
TST tmp ; positive number?
BREQ .atol_done
.
.
.
In order to have a correct conversion the line
with the "CLR tmp" must be added. Or even better (by Christian Ludlam): Replace
the
BLD tmp, 0 ; get sign again
TST tmp ; positive number?
BREQ .atol_done
simply by
BRTC .atol_done
Regards
Olaf
No Followups Have Been Posted
CC list is empty
File Attachments
****************
-------------------------------------------------------
Date: 2003-Feb-14 15:28 Name: atoi.S Size: 3KB By: rpato
http://savannah.nongnu.org/bugs/download.php?group_id=2140&bug_id=2481&bug_file_id=300
-------------------------------------------------------
Date: 2003-Feb-14 15:27 Name: atol.S Size: 3KB By: rpato
http://savannah.nongnu.org/bugs/download.php?group_id=2140&bug_id=2481&bug_file_id=299
For detailed info, follow this link:
http://savannah.nongnu.org/bugs/?func=detailbug&bug_id=2481&group_id=2140