Here's a little trick for bounds checks:

Code:
if(a < 0 || a >= MAX) { error }; //instead of this,

if((unsigned)a >= MAX) //compile time optimization
Back on topic, I was really only looking at his code for safety and bugs, which is basically the main prerequisite for write access.