diff packages/redboot/current/src/printf.c @ 154:e2d866e32dac

Merge from eCos master repository on 2001-02-26-23:18:05-GMT
author jlarmour
date Tue, 27 Feb 2001 01:21:45 +0000
parents 6ed91473a1cd
children b939e9cada46
line wrap: on
line diff
--- a/packages/redboot/current/src/printf.c
+++ b/packages/redboot/current/src/printf.c
@@ -23,7 +23,7 @@
 //                                                                          
 // The Initial Developer of the Original Code is Red Hat.                   
 // Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.                             
 // All Rights Reserved.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -178,12 +178,13 @@ static int
                 res++;
             }
             while (length-- > 0) {
-                (*putc)(c = *cp++);
-                res++;
+                c = *cp++;
                 if (c == '\n') {
                     (*putc)('\r');
                     res++;
                 }
+                (*putc)(c);
+                res++;
             }
             if (pad_on_right) {
                 while (pad-- > 0) {
@@ -192,12 +193,12 @@ static int
                 }
             }
         } else {
-            (*putc)(c);
-            res++;
             if (c == '\n') {
                 (*putc)('\r');
                 res++;
             }
+            (*putc)(c);
+            res++;
         }
     }
     return (res);