Returns whether the given command string contains lines longer than the given * maximum. */
| 75 | * maximum. |
| 76 | */ |
| 77 | int check_cmd_for_too_long_lines( char const * command, int32_t max, |
| 78 | int32_t * const error_length, int32_t * const error_max_length ) |
| 79 | { |
| 80 | while ( *command ) |
| 81 | { |
| 82 | int32_t const l = int32_t(strcspn( command, "\n" )); |
| 83 | if ( l > max ) |
| 84 | { |
| 85 | *error_length = l; |
| 86 | *error_max_length = max; |
| 87 | return EXEC_CHECK_LINE_TOO_LONG; |
| 88 | } |
| 89 | command += l; |
| 90 | if ( *command ) |
| 91 | ++command; |
| 92 | } |
| 93 | return EXEC_CHECK_OK; |
| 94 | } |
| 95 | |
| 96 | |
| 97 | /* Checks whether the given shell list is actually a request to execute raw |
no test coverage detected