title: Append a character at the end of a malloc'd string
body: <p>I am looking for a '.' character in a file.
  I use the function <strong>read</strong> to look for it.
  The problem is that I have a buffer size and I need to loop as long as I don't find the '.' character with <code>read(fd, buffer, bufferSize)</code>.
  I used <strong>malloc</strong> to allocate the memory for 1 buffer size (<code>char *buffer = malloc((bufferSize + 1) * sizeof(char))</code>), but I don't know how many times I'll have to loop.
  How can I add memory to the buffer depending on the buffer size loops I'll do ?</p>