diff options
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/modutils-24.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modutils/modutils-24.c b/modutils/modutils-24.c index 9f91c9979..e5ff54d29 100644 --- a/modutils/modutils-24.c +++ b/modutils/modutils-24.c | |||
@@ -2432,11 +2432,11 @@ new_process_module_arguments(struct obj_file *f, const char *options) | |||
2432 | loc = contents + sym->value; | 2432 | loc = contents + sym->value; |
2433 | 2433 | ||
2434 | if (*pinfo == 'c') { | 2434 | if (*pinfo == 'c') { |
2435 | if (!isdigit(*(pinfo + 1))) { | 2435 | if (!isdigit(pinfo[1])) { |
2436 | bb_error_msg_and_die("parameter type 'c' for %s must be followed by" | 2436 | bb_error_msg_and_die("parameter type 'c' for %s must be followed by" |
2437 | " the maximum size", param); | 2437 | " the maximum size", param); |
2438 | } | 2438 | } |
2439 | charssize = strtoul(pinfo + 1, (char **) NULL, 10); | 2439 | charssize = strtoul(pinfo + 1, NULL, 10); |
2440 | } | 2440 | } |
2441 | 2441 | ||
2442 | if (val == NULL) { | 2442 | if (val == NULL) { |
@@ -2449,6 +2449,8 @@ new_process_module_arguments(struct obj_file *f, const char *options) | |||
2449 | n = 0; | 2449 | n = 0; |
2450 | p = val; | 2450 | p = val; |
2451 | while (*p != 0) { | 2451 | while (*p != 0) { |
2452 | char *endp; | ||
2453 | |||
2452 | if (++n > max) | 2454 | if (++n > max) |
2453 | bb_error_msg_and_die("too many values for %s (max %d)", param, max); | 2455 | bb_error_msg_and_die("too many values for %s (max %d)", param, max); |
2454 | 2456 | ||
@@ -2472,19 +2474,23 @@ new_process_module_arguments(struct obj_file *f, const char *options) | |||
2472 | p += len; | 2474 | p += len; |
2473 | break; | 2475 | break; |
2474 | case 'b': | 2476 | case 'b': |
2475 | *loc++ = strtoul(p, &p, 0); | 2477 | *loc++ = strtoul(p, &endp, 0); |
2478 | p = endp; /* gcc likes temp var for &endp */ | ||
2476 | break; | 2479 | break; |
2477 | case 'h': | 2480 | case 'h': |
2478 | *(short *) loc = strtoul(p, &p, 0); | 2481 | *(short *) loc = strtoul(p, &endp, 0); |
2479 | loc += tgt_sizeof_short; | 2482 | loc += tgt_sizeof_short; |
2483 | p = endp; | ||
2480 | break; | 2484 | break; |
2481 | case 'i': | 2485 | case 'i': |
2482 | *(int *) loc = strtoul(p, &p, 0); | 2486 | *(int *) loc = strtoul(p, &endp, 0); |
2483 | loc += tgt_sizeof_int; | 2487 | loc += tgt_sizeof_int; |
2488 | p = endp; | ||
2484 | break; | 2489 | break; |
2485 | case 'l': | 2490 | case 'l': |
2486 | *(long *) loc = strtoul(p, &p, 0); | 2491 | *(long *) loc = strtoul(p, &endp, 0); |
2487 | loc += tgt_sizeof_long; | 2492 | loc += tgt_sizeof_long; |
2493 | p = endp; | ||
2488 | break; | 2494 | break; |
2489 | default: | 2495 | default: |
2490 | bb_error_msg_and_die("unknown parameter type '%c' for %s", | 2496 | bb_error_msg_and_die("unknown parameter type '%c' for %s", |