[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: |
Mon, 03 Mar 2003 16:33:13 -0500 |
=================== BUG #2481: LATEST MODIFICATIONS ==================
http://savannah.nongnu.org/bugs/?func=detailbug&bug_id=2481&group_id=2140
Changes by: Joerg Wunsch <address@hidden>
Date: Mon 03/03/03 at 22:33 (Europe/Berlin)
What | Removed | Added
---------------------------------------------------------------------------
Status | Open | Closed
------------------ Additional Follow-up Comments ----------------------------
Fixed in rev 1.4 of atoi.S, and reb 1.5 of atol.S.
=================== BUG #2481: FULL BUG SNAPSHOT ===================
Submitted by: zenker Project: AVR C Runtime Library
Submitted on: Wed 02/05/03 at 15:40
Category: None Severity: 5 - Major
Bug Group: None Resolution: Fixed
Assigned to: rpato Originator Email: address@hidden
Status: Closed
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
Follow-up Comments
*******************
-------------------------------------------------------
Date: Mon 03/03/03 at 22:33 By: joerg_wunsch
Fixed in rev 1.4 of atoi.S, and reb 1.5 of atol.S.
CC list is empty
File Attachments
****************
-------------------------------------------------------
Date: Fri 02/14/03 at 16: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: Fri 02/14/03 at 16: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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [avr-libc-dev] [Bug #2481] atoi.S and atol.S: incorrect handling of post characters if not \0,
nobody <=