32 lines
790 B
Diff
32 lines
790 B
Diff
|
Now that we have simple_strtoul() we can use it in getval().
|
||
|
|
||
|
Index: memtest86+-1.70/lib.c
|
||
|
===================================================================
|
||
|
--- memtest86+-1.70.orig/lib.c
|
||
|
+++ memtest86+-1.70/lib.c
|
||
|
@@ -683,21 +683,7 @@ ulong getval(int x, int y, int result_sh
|
||
|
shift -= result_shift;
|
||
|
|
||
|
/* Compute our current value */
|
||
|
- val = 0;
|
||
|
- for(i = (base == 16)? 2: 0; i < n; i++) {
|
||
|
- unsigned long digit = 0;
|
||
|
- if ((buf[i] >= '0') && (buf[i] <= '9')) {
|
||
|
- digit = buf[i] - '0';
|
||
|
- }
|
||
|
- else if ((buf[i] >= 'a') && (buf[i] <= 'f')) {
|
||
|
- digit = buf[i] - 'a' + 10;
|
||
|
- }
|
||
|
- else {
|
||
|
- /* It must be a suffix byte */
|
||
|
- break;
|
||
|
- }
|
||
|
- val = (val * base) + digit;
|
||
|
- }
|
||
|
+ val = simple_strtoul(buf, NULL, base);
|
||
|
if (shift > 0) {
|
||
|
if (shift >= 32) {
|
||
|
val = 0xffffffff;
|
||
|
|
||
|
--
|