Correct buffer size parameter in snprintf calls

There are approx. 240 snprintf calls that set the target buffer size to
out_len - 1 or similar. This "mind the null character" subtraction is
unnecessary since snprintf already includes the string termination into
the given buffer size.
This commit is contained in:
R. Yushaev
2018-12-07 10:37:56 +01:00
parent 15ece0902f
commit 074fad9fef
6 changed files with 241 additions and 241 deletions
+2 -2
View File
@@ -100,12 +100,12 @@ static void get_install_dir (char *install_dir, const char *exec_path)
#if defined (_POSIX)
static void get_profile_dir (char *profile_dir, const char *home_dir)
{
snprintf (profile_dir, HCBUFSIZ_TINY - 1, "%s/%s", home_dir, DOT_HASHCAT);
snprintf (profile_dir, HCBUFSIZ_TINY, "%s/%s", home_dir, DOT_HASHCAT);
}
static void get_session_dir (char *session_dir, const char *profile_dir)
{
snprintf (session_dir, HCBUFSIZ_TINY - 1, "%s/%s", profile_dir, SESSIONS_FOLDER);
snprintf (session_dir, HCBUFSIZ_TINY, "%s/%s", profile_dir, SESSIONS_FOLDER);
}
#endif