Skip to content

Commit

Permalink
Code improvement and docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Aug 18, 2021
1 parent 6d0caff commit 01aa174
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion nasl/nasl_scanner_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ isalldigit (char *str, int len)
* scanner.
*/

/**
* @brief Add timeout preference to VT preferences
*
* VT timeout is handled as normal VT preference.
* Because of backward compatibility issues the timeout preference is always
* located at the VT pref location with id NVTPREF_TIMEOUT_ID.
*
* @param[in] lexic lexic
* @param[in] to script timeout
*
* @return FAKE_CELL
*/
tree_cell *
script_timeout (lex_ctxt *lexic)
{
Expand All @@ -95,7 +107,7 @@ script_timeout (lex_ctxt *lexic)

timeout = g_strdup_printf ("%d", to);

np = nvtpref_new (0, "timeout", "entry", timeout);
np = nvtpref_new (NVTPREF_TIMEOUT_ID, "timeout", "entry", timeout);
nvti_add_pref (nvti, np);
return FAKE_CELL;
}
Expand Down

0 comments on commit 01aa174

Please sign in to comment.