This nonull test will fail if you assume that the string is null terminated in layer 2. People have used a sprintf or strcpy to copy their string into another string. Since my layer 4 has a null character between the end of the text string and the checksum, the checksum would not be copied correctly.