When the Nul byte was written to the first byte beyond the end of buffer, it stepped on the first byte in the 4 byte integer x.
Make sure you correct all errors and warnings before examining the results of the program.
My gcc command line is:
"gcc -std=c18 -Wall -Wextra -Wpedantic -g -o program program.c"
I don't use Code::Blocks. Please refer to the user manual.
Also, check the links I found in a Google search.