odd behivor of loop function

A few points here.

  1. You don't have to do both serial.available and serial.read. serial.read will return -1 if no data is available.
  2. The handling of \n looks wrong to me. Putting a \0 will terminate the string, but you don't return
    or increment the character count. That may be your problem right there.
  3. Since your delay is outside of ReadComStr, it doesn't effect the function.
  4. it's entirely possible that if the sending side is very slow, there will be gaps between the characters when serial.available will say there's no data. It is more reliable to wait for the end of string marker, which you said was a return (\n) in this case.
  5. There's already a function that does this, (except for skipping the \r).
    see: Serial.readBytesUntil() - Arduino Reference