diff --git a/CMakeLists.txt b/CMakeLists.txt index 91cf74b..ee94d97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(microirc LANGUAGES C) if (CMAKE_C_COMPILER_ID STREQUAL "GNU") add_compile_options(-Wall -Wextra -Werror -Wformat-overflow=2 -Wformat-security -Winit-self -Wstrict-overflow=2 -Wstringop-overflow=2 -Walloc-zero -Wduplicated-branches -Wduplicated-cond -Wtrampolines -Wfloat-equal -Wshadow -Wunsafe-loop-optimizations -Wparentheses -pedantic -fanalyzer -fstack-check) elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_options(-Weverything -pedantic) + add_compile_options(-Weverything -Wno-padded -pedantic) endif() if (NOT CMAKE_BUILD_TYPE) diff --git a/src/tokenizers.c b/src/tokenizers.c index 0c84bbb..ec1c936 100644 --- a/src/tokenizers.c +++ b/src/tokenizers.c @@ -55,15 +55,16 @@ signed int Tok_mesg(char* str, IRC_Message* out) skip_spaces(&progr); int i; - for (i = 0; i < 15 && *progr; i++) { + for (i = 0; i < 15 && *progr;) { if (i == 14 || *progr == ':') { out->args[i++] = (*progr == ':') ? progr + 1 : progr; out->trailing = true; + break; } else { - if ((out->args[i] = strtok_mr(&progr, " ")) == NULL) + if ((out->args[i++] = strtok_mr(&progr, " ")) == NULL) return ERR_UIRC_INVALID_FORMAT; + skip_spaces(&progr); } - skip_spaces(&progr); } out->args[i] = NULL; return 1;