Fix segfault caused by off by one error

This commit is contained in:
rexy712 2019-01-15 11:39:51 -08:00
parent adea8f719e
commit f0247ac9c5

View File

@ -201,7 +201,7 @@ static constexpr size_t strlen_pre_eq(const char* str){
#define CHECK_VALID_SHORT_ARG(opt, arg, type) \
{ \
if(next_arg == (argc-1) || !is_##type(arg)){ \
if(next_arg == argc || !is_##type(arg)){ \
fwprintf(stderr, L"'-%s' requires an argument of type " #type "\n", opt); \
ret.error = 1; \
break; \