And this code isnt that great TBH. Agreed.
And yes, it does go to 256 if you include the null character. ;)