char p3[5] = "String"; while dangerous is not wrong and it is valid in C (but not in ... string is undefined behavior) according to the C programming language 2 ed.
stackoverflow.com