git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c3b25d8
)
fixed negative twip parsing problem
author
kramm
<kramm>
Tue, 8 Jul 2008 09:27:39 +0000
(09:27 +0000)
committer
kramm
<kramm>
Tue, 8 Jul 2008 09:27:39 +0000
(09:27 +0000)
src/swfc.c
patch
|
blob
|
history
diff --git
a/src/swfc.c
b/src/swfc.c
index
ee86802
..
f2224a1
100644
(file)
--- a/
src/swfc.c
+++ b/
src/swfc.c
@@
-2418,7
+2418,7
@@
int parseTwip(char*str)
char*p = str;
int val = 0;
char ex = 0;
char*p = str;
int val = 0;
char ex = 0;
- char*lastpos = str;
+ char*lastpos = 0;
while(*p) {
if(*p == '+' || *p == '-' || *p == '/' || *p == '*')
ex = *p;
while(*p) {
if(*p == '+' || *p == '-' || *p == '/' || *p == '*')
ex = *p;
@@
-2440,6
+2440,7
@@
int parseTwip(char*str)
v = parseRawTwip(lastpos);
}
*p = save;
v = parseRawTwip(lastpos);
}
*p = save;
+ printf("%f %c= %f\n", val/20.0, ex, v/20.0);
if(ex == '+')
val += v;
else if(ex == '-')
if(ex == '+')
val += v;
else if(ex == '-')
@@
-2454,6
+2455,7
@@
int parseTwip(char*str)
lastpos = 0;
}
}
lastpos = 0;
}
}
+ printf("%s -> %.2f\n", str, val/20.0);
return val;
}
return val;
}