Skip to content

Commit

Permalink
WIP : Static analysis fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdelnero committed Nov 13, 2023
1 parent 98ce44b commit 8703b5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib_jtag_core/src/bsdl_parser/bsdl_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ jtag_bsdl * load_bsdlfile(jtag_core * jc,char *filename)
if(filename[i] == '\\')
i++;

strncpy(bsdl->src_filename,&filename[i],sizeof(bsdl->src_filename));
strncpy(bsdl->src_filename,&filename[i],sizeof(bsdl->src_filename) - 1);
bsdl->src_filename[ sizeof(bsdl->src_filename) - 1 ] = '0';

///////////////////////
Expand Down
4 changes: 2 additions & 2 deletions lib_jtag_core/src/jtag_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,12 @@ int jtagcore_get_dev_name(jtag_core * jc, int device, char * devname, char * bsd

if(devname)
{
devname[0] = 0;
devname[0] = '\0';
}

if(bsdlpath)
{
bsdlpath[0] = 0;
bsdlpath[0] = '\0';
}

return JTAG_CORE_NO_ERROR;
Expand Down
5 changes: 3 additions & 2 deletions lib_jtag_core/src/script/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -1353,8 +1353,9 @@ static int cmd_autoinit( script_ctx * ctx, char * line)

genos_getcurrentdirectory(szExecPath,MAX_PATH);

strcpy(scanfolder,szExecPath);
strcat(scanfolder,DIR_SEPARATOR"bsdl_files"DIR_SEPARATOR);
strncpy(scanfolder, szExecPath, sizeof(scanfolder) );
genos_strndstcat(scanfolder, DIR_SEPARATOR"bsdl_files"DIR_SEPARATOR, sizeof(scanfolder) - 1 );
scanfolder[sizeof(scanfolder) - 1] = '\0';

h_file_find = genos_find_first_file( scanfolder, "*.*", &fileinfo );

Expand Down

0 comments on commit 8703b5c

Please sign in to comment.