summaryrefslogtreecommitdiff
path: root/printf.c
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-28 18:37:41 +0000
committerrsc <rsc>2007-08-28 18:37:41 +0000
commit5516be1fed10ac87848668964c495266d02ae915 (patch)
treeb3f85375a1ccd347861e9eea34d644cc9824c444 /printf.c
parente4d6a21165c01dd743a68e323fb06708ef820ab7 (diff)
downloadxv6-labs-5516be1fed10ac87848668964c495266d02ae915.tar.gz
xv6-labs-5516be1fed10ac87848668964c495266d02ae915.tar.bz2
xv6-labs-5516be1fed10ac87848668964c495266d02ae915.zip
spaces around else for rtm
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/printf.c b/printf.c
index a5c660a..9972b45 100644
--- a/printf.c
+++ b/printf.c
@@ -20,7 +20,7 @@ printint(int fd, int xx, int base, int sgn)
if(sgn && xx < 0){
neg = 1;
x = -xx;
- }else{
+ } else {
x = xx;
}
@@ -50,17 +50,17 @@ printf(int fd, char *fmt, ...)
if(state == 0){
if(c == '%'){
state = '%';
- }else{
+ } else {
putc(fd, c);
}
- }else if(state == '%'){
+ } else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
- }else if(c == 'x' || c == 'p'){
+ } else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
- }else if(c == 's'){
+ } else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
@@ -69,12 +69,12 @@ printf(int fd, char *fmt, ...)
putc(fd, *s);
s++;
}
- }else if(c == 'c'){
+ } else if(c == 'c'){
putc(fd, *ap);
ap++;
- }else if(c == '%'){
+ } else if(c == '%'){
putc(fd, c);
- }else{
+ } else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);