I've thought about this before, but If `p[0]` is `'\0'` then the condition should short-circuit. Here's an example in D:

```
import std.stdio;

void main()
{
    string p;

    p = ".\0";  // no range violation
    writeln(p[0] == '.' && p[1] == '.' && p[2] == '.');

    p = "\0";  // no range violation
    writeln(p[0] == '.' && p[1] == '.' && p[2] == '.');

    p = "\0";  // range violation due to lack of short-circuit
    writeln(p[0] == '.' || p[1] == '.' || p[2] == '.');
}
```