Changeable password lock system

code_buff1 and code_buff2 are being declared as fixed values, they are not dynamically allocated. If you want the code length to be exactly 6 digits you can just declare char code_buff1[6] no?

But what I am saying is- at what point in the code are you encountering a problem? And what happens specifically?