return 0 if file not found

This commit is contained in:
Jonas Hofmann 2025-10-31 01:13:56 +01:00
parent 63cafdbc0c
commit 1affb13041

View File

@ -9,6 +9,12 @@ static char *singleWordBuffer;
// eine Funktion implementieren, die ein einzelnes Wort aus einer Textdatei (words.txt) einliest und als C-String zurückgibt.
char *readSingleWord(FILE *file)
{
if (file == NULL)
{
return 0;
}
fgets(singleWordBuffer, MAX_LINE_LEN, file);
}