Cleaned redundant code

* Deleted unreachable code
* Made code DRY
* if(condition) return true; else false;
  -> return condition
Removed meaningless code

* No self repeat
Made code more safe

* I hate #define
* scanf("%s", &buffer) is harmful
Changed whitespace character of the code in my taste

* tab -> space*2