fix gcc warnings

I made whitespace a bit more consistent and fixed the gcc warnings by properly casting the buf argument to strcmp in line 105.