Skip to content

Commit

Permalink
Fix: path for logging scripts run duration (#1818)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola authored Jan 16, 2025
1 parent 4676170 commit 4516a3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ attack_network (struct scan_globals *globals)
char *path = g_strdup_printf (
"%s/%s-stats.json", prefs_get ("report_scripts"), globals->scan_id);

write_script_stats (buff, globals->scan_id, 1);
write_script_stats (buff, path, 1);

g_free (buff);
g_free (path);
Expand Down
4 changes: 2 additions & 2 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ write_script_stats (const char *buf, const char *path, int mode)
pd = fopen (path, mode == 0 ? "a" : mode == 1 ? "r+" : "w");
if (pd == NULL)
{
g_warning ("%s: Error opening FILE for script stats: %d - %s", __func__,
errno, strerror (errno));
g_warning ("%s: Error opening FILE '%s' for script stats: %d - %s", __func__,
path, errno, strerror (errno));
return;
}

Expand Down

0 comments on commit 4516a3f

Please sign in to comment.