yyang42 / moulitest

This repository contains tests for several projects done at 42.
127 stars 37 forks source link

changed number of bytes in write function to match string length #55

Closed installwindows closed 7 years ago

installwindows commented 7 years ago

The write function writes 4 extra bytes containing random values to the fd. Most of the times, the first of theses values is 0 witch doesn't cause issues with most implementation of gnl, but the result can be considered a binary file. In that case, the test is broken since reading from a binary files is an undefined behavior.

yyang42 commented 7 years ago

Good catch!

It's a bad idea to have random values in tests, so thanks for fixing that :)