fix %c in printf_fast, printf_fast_f and printf_tiny
authorpjs <pjs@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 25 Jan 2007 20:57:29 +0000 (20:57 +0000)
committerpjs <pjs@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 25 Jan 2007 20:57:29 +0000 (20:57 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4598 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/lib/printf_fast.c
device/lib/printf_tiny.c

index cdcaafbbcf0be09423e29007fda407df9fb6ad5d..c626756c16302c43ca7e85c5538ae45ab815f741 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-01-25 Paul Stoffregen <paul AT pjrc.com>
+       * device/lib/printf_fast.c: fix %c, char promoted to int
+       * device/lib/printf_tiny.c: fix %c, char promoted to int
+
 2007-01-25 Paul Stoffregen <paul AT pjrc.com>
        * device/lib/printf_fast.c: fix float overflow check, bug #1525093
 
index 71281f4a1acf0235f2c1b8c02742b7ee26f78984..63a4308e2aee918ab0bf31a24609bc4f75668e09 100644 (file)
@@ -236,6 +236,7 @@ printf_format_u:
 printf_format_c:
        //cjne  a, #'c', printf_format_x
        cjne    a, #99, printf_format_x
+       dec     r0
        mov     a, @r0          // Acc has the character to print
        dec     r0
        sjmp    printf_char
index 4d8543854f643a5d7b31b69d538056f6e4f9ef34..3a889f404d0a57a22fe0c0cfef52e1eb96eb9b5a 100644 (file)
@@ -131,6 +131,7 @@ printf_str_loop:
 printf_format_c:
        //cjne  a, #'c', printf_format_d
        cjne    a, #99, printf_format_d
+       dec     r0
        mov     a, @r0          // Acc has the character to print
        dec     r0
        lcall   printf_putchar