View | Details | Raw Unified | Return to bug 27729 | Differences between
and this patch

Collapse All | Expand All

(-)a/branches/ucs-3.0/ucs/management/univention-directory-listener/src/main.c (-1 / +6 lines)
 Lines 79-88   static char* read_pwd_from_file(char *filename) Link Here 
79
79
80
	if ((fp = fopen(filename, "r")) == NULL)
80
	if ((fp = fopen(filename, "r")) == NULL)
81
		return NULL;
81
		return NULL;
82
	if (fgets(line, 1024, fp) == NULL)
82
	if (fgets(line, 1024, fp) == NULL) {
83
		fclose(fp);
83
		return NULL;
84
		return NULL;
85
	}
86
	fclose(fp);
84
87
85
	len = strlen(line);
88
	len = strlen(line);
89
	if (!len)
90
		return NULL;
86
	if (line[len-1] == '\n')
91
	if (line[len-1] == '\n')
87
		line[len-1] = '\0';
92
		line[len-1] = '\0';
88
93

Return to bug 27729