fix: bsdl folder error printed uninitialized buffer

In cmd_autoinit, when find_first_file fails to open ./bsdl_files/ the
error path printed `filename` — which is only populated inside the
directory-walk loop. Outside that loop it is uninitialized stack
content, leading to garbage in the error message (and a confusing
diagnostic when bs is launched from a directory without a bsdl_files/
subfolder, e.g. build/).

Print `scanfolder` (the actual path that was attempted) instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 10:48:46 +02:00
parent 1febae7377
commit 0bd109c209

View File

@@ -1571,7 +1571,7 @@ static int cmd_autoinit(script_ctx *ctx, char *line)
} }
else else
{ {
ctx->script_printf(ctx, MSG_ERROR, "Can't access the bsdl sub folder ! : %s\n", filename); ctx->script_printf(ctx, MSG_ERROR, "Can't access the bsdl sub folder ! : %s\n", scanfolder);
return JTAG_CORE_ACCESS_ERROR; return JTAG_CORE_ACCESS_ERROR;
} }