From 26ae763379472b177f99e3d906bb6e8dffde0dba Mon Sep 17 00:00:00 2001 From: PartialVolume <22084881+PartialVolume@users.noreply.github.com> Date: Tue, 24 Oct 2023 20:22:23 +0100 Subject: [PATCH] Fix_warning_directive_output_may_be_truncated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed the following warning: create_pdf.c:795:18: warning: ‘/nwipe_report_’ directive output may be truncated writing 14 bytes into a region of size between 1 and 4096 [-Wformat-truncation=] --- src/options.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/options.h b/src/options.h index f6edb545..40735851 100644 --- a/src/options.h +++ b/src/options.h @@ -38,6 +38,7 @@ #define MAX_NUMBER_EXCLUDED_DRIVES 10 #define MAX_DRIVE_PATH_LENGTH 200 // e.g. /dev/sda is only 8 characters long, so 200 should be plenty. #define DEFAULT_SYNC_RATE 100000 +#define PATHNAME_MAX 2048 /* Function prototypes for loading options from the environment and command line. */ int nwipe_options_parse( int argc, char** argv ); @@ -58,7 +59,7 @@ typedef struct char* banner; // The product banner shown on the top line of the screen. void* method; // A function pointer to the wipe method that will be used. char logfile[FILENAME_MAX]; // The filename to log the output to. - char PDFreportpath[FILENAME_MAX]; // The path to write the PDF report to. + char PDFreportpath[PATHNAME_MAX]; // The path to write the PDF report to. char exclude[MAX_NUMBER_EXCLUDED_DRIVES][MAX_DRIVE_PATH_LENGTH]; // Drives excluded from the search. nwipe_prng_t* prng; // The pseudo random number generator implementation. pointer to the function. int quiet; // Anonymize serial numbers