소스 검색

search_for_named_library forgot to wipe the target string, so each time
around the loop it was getting bigger...

Eric Andersen 23 년 전
부모
커밋
ea9de29581
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      ldso/util/ldd.c

+ 1 - 1
ldso/util/ldd.c

@@ -123,8 +123,8 @@ static void search_for_named_library(char *name, char *result, const char *path_
 	}
 
 	path_n = path;
-	*result = '\0';
 	for (i = 0; i < count; i++) {
+		*result = '\0';
 		strcat(result, path_n); 
 		strcat(result, "/"); 
 		strcat(result, name);