Branch data Line data Source code
1 : : // Copyright 2022 David Robillard <d@drobilla.net> 2 : : // SPDX-License-Identifier: ISC 3 : : 4 : : #ifndef ZIX_TEST_ARGS_H 5 : : #define ZIX_TEST_ARGS_H 6 : : 7 : : #include <stddef.h> 8 : : #include <stdlib.h> 9 : : 10 : : static inline size_t 11 : 6 : zix_test_size_arg(const char* const string, const size_t min, const size_t max) 12 : : { 13 : 6 : const size_t size = strtoul(string, NULL, 10); 14 : : 15 [ + - ]: 6 : return size < min ? min : size > max ? max : size; 16 : : } 17 : : 18 : : #endif // ZIX_TEST_ARGS_H