New comment by balejk on void-packages repository https://github.com/void-linux/void-packages/pull/45617#issuecomment-1858452021 Comment: This is not stale, I can still reproduce the issue. To add some context, I discovered this when running aerc's test suite, which also tests a C program for wrapping emails. This test failed because the program only wrapped part of the text and stripped the rest because fgetws did not correctly recognize EOF. Below is a minimal working example along with the test text courtesy of aerc: ```c #include #include #include #include #define BUFFER_SIZE 8192 int main() { FILE *in = fopen("mwe.in", "r"); wchar_t buf[BUFFER_SIZE]; setlocale(LC_ALL, ""); while (fgetws(buf, BUFFER_SIZE, in)) { fwprintf(stdout, buf); } fclose(in); return 0; } ``` ``` Λορεμ ιπσθμ δολορ σιτ αμετ, ρεβθμ φαλλι γραεcισ θτ θσθ, θσθ ομνισ μοδθσ ατομορθμ ει, δθο εραντ πραεσεντ νο. Εξ εθμ μολεστιαε ιντελλεγαμ, σεα λαβιτθρ αλιενθμ τε. Θσθ αν τεμπορ φορενσιβθσ, σιτ διcτα διcερετ ποσιδονιθμ ατ. Σενσεριτ δισσεντιθντ ει μελ, φεθγιατ πλαcερατ περ cθ. Εα σιτ μοδθσ νονθμυ μελιορε, ιντεγρε θλλαμcορπερ νε cθμ. Εα νεc σαεπε μανδαμθσ, qθισ vολθπτθα cονσθλατθ νο vελ. Ηισ cθ νεμορε ποσσιμ. Αν προ φαcερ αργθμεντθμ, ατ μαλορθμ ιμπερδιετ ιντελλεγαμ θσθ, αδ πρι λθcιλιθσ σcριπσεριτ. Θσθ ιν σολθμ διcατ δεμοcριτθμ, σιμθλ σcριπσεριτ εθ μει, vιξ εξ ειρμοδ αccθσατα. Qθι ιμπεδιτ cοπιοσαε ιμπερδιετ εα, αφφερτ ορνατθσ ηισ εθ, αεqθε τολλιτ cονσεcτετθερ νε προ! Ιπσθμ σεντεντιαε ετ προ, αθτεμ σθαvιτατε cονστιτθαμ εξ qθι? Ταντασ λεγερε qθι ιδ? Θσθ νισλ νιηιλ ηενδρεριτ τε! Ιπσθμ νθσqθαμ ιθσ εξ? Ηισ αν ιπσθμ λατινε δισσεντιθντ. Vιμ αλιqθιδ τεμποριβθσ vολθπτατιβθσ αδ, αδ πρι δομινγ απεριρι δισπθτατιονι. Vιμ σθμμο αφφερτ εα, νονθμυ ποσσιτ φαβθλασ ατ εστ. ``` Save the above text as `mwe.in` and execute the above program within the same directory. Only part of the text will get printed back. This could potentially lead to some information loss for people who use this program (`wrap`) with aerc on musl because it could strip out part of a received message while wrapping it.