File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -136,16 +136,16 @@ static inline bool c3_is_digit (char c) {
136
136
}
137
137
138
138
static int32_t get_digit_long (char * * p ) {
139
- int32_t res = 0 , dig = 1 ;
139
+ int32_t res = 0 ;
140
140
int sign = 1 ;
141
141
if (* * p == '-' ) {
142
142
sign = -1 ;
143
143
(* p )++ ;
144
144
}
145
145
//XXX may overflow. and must treat invalid num, like 8p30
146
146
while (c3_is_digit (* * p )) {
147
- res += ( * * p - '0' ) * dig ;
148
- dig *= 10 ;
147
+ res *= 10 ;
148
+ res += ( * * p - '0' ) ;
149
149
(* p )++ ;
150
150
}
151
151
res *= sign ;
Original file line number Diff line number Diff line change
1
+ c This is example of random form
2
+ c Author rkx1209
3
+ p cnf 20 5
4
+ 4 5 11 13 14 -11 17 -17 0
5
+ 3 -5 12 20 10 -1 7 4 0
6
+ 1 -19 18 15 -10 5 -17 4 0
7
+ -12 5 0
8
+ 9 14 15 16 20 0
You can’t perform that action at this time.
0 commit comments