Mercurial > ecos
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 153:5e8f3b328bb3 | 154:e2d866e32dac |
|---|---|
| 21 // The Original Code is eCos - Embedded Configurable Operating System, | 21 // The Original Code is eCos - Embedded Configurable Operating System, |
| 22 // released September 30, 1998. | 22 // released September 30, 1998. |
| 23 // | 23 // |
| 24 // The Initial Developer of the Original Code is Red Hat. | 24 // The Initial Developer of the Original Code is Red Hat. |
| 25 // Portions created by Red Hat are | 25 // Portions created by Red Hat are |
| 26 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. | 26 // Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. |
| 27 // All Rights Reserved. | 27 // All Rights Reserved. |
| 28 // ------------------------------------------- | 28 // ------------------------------------------- |
| 29 // | 29 // |
| 30 //####COPYRIGHTEND#### | 30 //####COPYRIGHTEND#### |
| 31 //========================================================================== | 31 //========================================================================== |
| 176 if (sign != '\0') { | 176 if (sign != '\0') { |
| 177 (*putc)(sign); | 177 (*putc)(sign); |
| 178 res++; | 178 res++; |
| 179 } | 179 } |
| 180 while (length-- > 0) { | 180 while (length-- > 0) { |
| 181 (*putc)(c = *cp++); | 181 c = *cp++; |
| 182 res++; | |
| 183 if (c == '\n') { | 182 if (c == '\n') { |
| 184 (*putc)('\r'); | 183 (*putc)('\r'); |
| 185 res++; | 184 res++; |
| 186 } | 185 } |
| 186 (*putc)(c); | |
| 187 res++; | |
| 187 } | 188 } |
| 188 if (pad_on_right) { | 189 if (pad_on_right) { |
| 189 while (pad-- > 0) { | 190 while (pad-- > 0) { |
| 190 (*putc)(' '); | 191 (*putc)(' '); |
| 191 res++; | 192 res++; |
| 192 } | 193 } |
| 193 } | 194 } |
| 194 } else { | 195 } else { |
| 196 if (c == '\n') { | |
| 197 (*putc)('\r'); | |
| 198 res++; | |
| 199 } | |
| 195 (*putc)(c); | 200 (*putc)(c); |
| 196 res++; | 201 res++; |
| 197 if (c == '\n') { | |
| 198 (*putc)('\r'); | |
| 199 res++; | |
| 200 } | |
| 201 } | 202 } |
| 202 } | 203 } |
| 203 return (res); | 204 return (res); |
| 204 } | 205 } |
| 205 | 206 |
