Univention Bugzilla – Attachment #4475: Close file descriptor for bug #27729
{
FILE *fp;
char line[1024];
int len;
int len = 0;
if ((fp = fopen(filename, "r")) == NULL)
return NULL;
if (fgets(line, 1024, fp) == NULL)
len = 0;
fclose(fp);
if (!len)
len = strlen(line);
if (line[len-1] == '\n')
line[len-1] = '\0';