Coding a getline() implementation - Valgrind errors
问题 I have to recode an implementation of the getline() function, but using the file descriptor of the file and not a FILE * . I am only allowed to use malloc() and free() , along with 5 functions being 25 lines long at most. I think I've done correctly the project although I am a beginner in C and my code isn't probably good. When I run it, it works fine, but valgrind shows that I definetely lost x bytes , x depending of the file length and the READ_SIZE (macro defined in the header). According