line 299 and 335 in void turn(char input) - just use return, return NULL implies the function is going to return a value, when it does not.

line 376 and 377 - direction[1] is never initialized (you should at least put it to 0 at the start of the function) and direction[0] may not be initialized (same as previous).

line 454 and 455 - iter is used as an int, it should be an int.  it's also never initialized.  Use a for loop instead of a while for counting.  with -std=c99 you can do:
  for(int iter = 0; iter < 100; iter++) { x = x / 2 + n / (2 * x); }

i will also suggest looking into switch statements instead of if/else if statements.  it can make the code cleaner and easier to read.
updated maggot.c with my suggestions.

void grow(void) - changed to switch statement. moved each statement to their own line.

void turn(char input) - changed all inputs to a switch statement.  changed the if statements checking the snake's direction to their inverse (!= && !=) to remove the empty statement.

void move() - changed to switch statement.

double sqrt(float n) - changed the while loop to for and iter to an int.
Merge https://github.com/falziots/maggot

Conflicts:
	src/maggot.c
updated source.

some of the code doesn't look right, will test.
put some comments for guidance, only 4 lines are not needed.

line 258 (void grow()) - 4 statements are off. commented out statements that aren't needed (tested and it works without them).  The statements are overwritting themselves, so check the logic for them.

line 331 (void turn(char input, int map_height)) - KEY_ESC and '[' just exit the function, not sure if you wanted them to act like 'q' or to act like "default".

line 465 (void wait_for_key(char k, bool any)) - using getch() multiple times in if statements could cause undesired affects.  Normally a local variable is used to hold what getch returns then checked.  any && getch() only pulls from getch if any is true, if getch then returns NULL or 0 or anything false, then it will be pulled from again and can cause a seg fault or other undesired affects.

line 522 (double my_sqrt(float n)) - changed while loop to a for loop.
Merge pull request #1 from damikin/master

line 299 and 335 in void turn(char input) - just use return, return NULL...