2) Change an int for a size_t, as that's what it is mainly used for. 3) Add some braces to keep gcc happy.