memstr
1 //find 'substr' from a fixed-length buffer 2 //('full_data' will be treated as binary data buffer) 3 //return NULL if not found 4 char* memstr(char* full_data, int full_data_len, char* substr) 5 { 6 if (full_data == NULL || full_data_len <= 0 || substr == NULL) { 7 return NULL; 8 } 9 10 if (*substr == '