Commit 897d4f1d authored by Jon Griffiths's avatar Jon Griffiths

tools/ccan_depends: Don't crash when no dependencies are found

Running 'tools/ccan_depends --compile ccan/crypto' without this
patch will demonstrate the crash.
Signed-off-by: default avatarJon Griffiths <jon_p_griffiths@yahoo.com>
parent b5291173
......@@ -46,8 +46,9 @@ int main(int argc, char *argv[])
else
deps = get_safe_ccan_deps(NULL, argv[1], style, recurse);
for (i = 0; deps[i]; i++)
if (strstarts(deps[i], "ccan/") == ccan)
printf("%s\n", deps[i]);
if (deps)
for (i = 0; deps[i]; i++)
if (strstarts(deps[i], "ccan/") == ccan)
printf("%s\n", deps[i]);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment