summaryrefslogtreecommitdiff
path: root/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/printf.c b/printf.c
index ad9c758..a5c660a 100644
--- a/printf.c
+++ b/printf.c
@@ -20,14 +20,14 @@ printint(int fd, int xx, int base, int sgn)
if(sgn && xx < 0){
neg = 1;
x = -xx;
- } else {
+ }else{
x = xx;
}
i = 0;
- do {
+ do{
buf[i++] = digits[x % base];
- } while((x /= base) != 0);
+ }while((x /= base) != 0);
if(neg)
buf[i++] = '-';
@@ -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);