소스 검색

Dont clobber stck on strings with length of zero.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1875 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 17 년 전
부모
커밋
06483f4900
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      lcr/lcr_ifact.c

+ 2 - 1
lcr/lcr_ifact.c

@@ -243,7 +243,8 @@ static int ldso_path_build (const char *path, const char *filename)
 	}
 
 	while (fgets (string, sizeof (string), fp)) {
-		string[strlen(string) - 1] = '\0';
+		if (strlen(string) > 0)
+			string[strlen(string) - 1] = '\0';
 		if (strncmp (string, "include", strlen ("include")) == 0) {
 			newpath_tmp = string + strlen ("include") + 1;
 			for (j = strlen (string);