Explorar el Código

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 hace 17 años
padre
commit
06483f4900
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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);