#include <unistd.h>
#include <stdarg.h>
#include <errno.h>
+#include <libcfs/util/string.h>
#define NUMPRINTCOLUMNS 32 /* # columns of data to print on each line */
char *good_buf; /* a pointer to the correct data */
char *temp_buf; /* a pointer to the current data */
char *fname; /* name of our test file */
-char logfile[1024]; /* name of our log file */
-char goodfile[1024]; /* name of our test file */
+char logfile[PATH_MAX]; /* name of our log file */
+char goodfile[PATH_MAX]; /* name of our test file */
off_t file_size = 0;
off_t biggest = 0;
return "";
if (max_tf_len == 0)
- max_tf_len = snprintf(tf_buf, sizeof(tf_buf) - 1,
+ max_tf_len = scnprintf(tf_buf, sizeof(tf_buf) - 1,
"%u", num_test_files - 1);
- sprintf(tf_buf, "[%0*lu]", max_tf_len,
+ snprintf(tf_buf, sizeof(tf_buf), "[%0*lu]", max_tf_len,
(unsigned long)(tf - test_files));
return tf_buf;
randomoplen = 0;
break;
case 'P':
- strncpy(goodfile, optarg, sizeof(goodfile));
+ strncpy(goodfile, optarg, sizeof(goodfile) - 1);
strcat(goodfile, "/");
- strncpy(logfile, optarg, sizeof(logfile));
+ strncpy(logfile, optarg, sizeof(logfile) - 1);
strcat(logfile, "/");
dirpath = 1;
break;