Modern systems use UTF-8 (or ASCII) as their multibyte encoding, where using this function is safe.
To be strictly compatible and make your code work even on old / exotic platforms, you need to consider additional problems.
Firstly, the good news: in every multibyte encoding, a 0-byte character indicates the end of the line, regardless of state. This means that your strstr will not crash or anything else, but the result may be wrong.
As an example, consider UTF-7, a 7-bit pure Unicode encoding method. UTF-7 is a multibyte encoding having a shift state, which means that the interpretation of the byte may depend on the context in which it appears. For instance. (see Wikipedia ) "£ 1AKM" is encoded as +AKM-AKM in UTF-7, where the + sign changes the state and interpretation of type A letters. Executing strstr(str, "AKM") will correspond to the first part of AKM (after + ), although this is part of the encoding £ and should actually correspond to the part of AKM after - (setting the shift state to the initial state).
mafso source share