| 1467 | } |
| 1468 | |
| 1469 | static int |
| 1470 | exec_args_add_str(struct image_args *args, const char *str, |
| 1471 | enum uio_seg segflg, int *countp) |
| 1472 | { |
| 1473 | int error; |
| 1474 | size_t length; |
| 1475 | |
| 1476 | KASSERT(args->endp != NULL, ("endp not initialized")); |
| 1477 | KASSERT(args->begin_argv != NULL, ("begin_argp not initialized")); |
| 1478 | |
| 1479 | error = (segflg == UIO_SYSSPACE) ? |
| 1480 | copystr(str, args->endp, args->stringspace, &length) : |
| 1481 | copyinstr(str, args->endp, args->stringspace, &length); |
| 1482 | if (error != 0) |
| 1483 | return (error == ENAMETOOLONG ? E2BIG : error); |
| 1484 | args->stringspace -= length; |
| 1485 | args->endp += length; |
| 1486 | (*countp)++; |
| 1487 | |
| 1488 | return (0); |
| 1489 | } |
| 1490 | |
| 1491 | int |
| 1492 | exec_args_add_arg(struct image_args *args, const char *argp, |
no test coverage detected