Strings have to be zero terminated. Replace
char ch[4];
with
char ch[5];
ch[4] = 0;
or something similar to have a zero after the string data.
Strings have to be zero terminated. Replace
char ch[4];
with
char ch[5];
ch[4] = 0;
or something similar to have a zero after the string data.