aboutsummaryrefslogtreecommitdiff
path: root/printf.c
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-05-04 11:41:39 +0800
committerTeddy <ted.sybil@gmail.com>2014-05-04 11:41:39 +0800
commit5aba86743d63a9d7000ce4e410ff7c61bcb0547f (patch)
treed96984551fb4c628e539b0e421ede0ad88080a6a /printf.c
parent5f8c8cb8293ecdd76a9fda30a9a7fdf7b89232cd (diff)
argument opt has been postponed
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/printf.c b/printf.c
index 488c0d5..6d3330b 100644
--- a/printf.c
+++ b/printf.c
@@ -1,5 +1,6 @@
int printf(char *fmt) {
char *arg, ch;
+ int len, x;
arg = (int)&fmt + sizeof(char*);
while ((ch = *fmt))
{
@@ -14,7 +15,7 @@ int printf(char *fmt) {
__print_string(*(char **)arg);
else
{
- int len, x = *(int *)arg;
+ x = *(int *)arg;
if (!x) len = 1;
else
for (len = 0; x; x /= 10, len++);