浏览代码

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);