thlorenz/learnuv

03_fs_readsync needs buffer length modification to run correctly.

coderkevin opened this issue · 1 comments

I'm not sure if it's supposed to be left as an exercise to the user, but I had to make a small off-topic modification to the buffer allocation to make this work. The reason was that the buffer doesn't have a null terminator as created, and it needs one for the log_report() and log_info() calls.

I fixed it by adding this, but the null terminator could be added in other ways, I suppose:

  char buf[BUF_SIZE + 1];
  memset(buf, 0, sizeof(buf));