aboutsummaryrefslogtreecommitdiff
path: root/src/sgp_dd.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2020-05-13 05:04:24 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2020-05-13 05:04:24 +0000
commiteda62fa0cd1d5886bd9893ba2831a37c5e24d4c7 (patch)
tree38069e363793c431e6b151501bb7f28f290207a6 /src/sgp_dd.c
parent0083e58d85910aa7c8599d06bfff48ea5f8c98d1 (diff)
downloadsg3_utils-eda62fa0cd1d5886bd9893ba2831a37c5e24d4c7.tar.gz
testing/sgh_dd: check for bs/READ_CAPACITY(LBsize) mismatch; fix some compile warnings and some --version issues
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@851 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sgp_dd.c')
-rw-r--r--src/sgp_dd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sgp_dd.c b/src/sgp_dd.c
index 9dd089d1..3975f038 100644
--- a/src/sgp_dd.c
+++ b/src/sgp_dd.c
@@ -22,7 +22,7 @@
* in this case) are transferred to or from the sg device in a single SCSI
* command.
*
- * This version is designed for the linux kernel 2.4, 2.6, 3 and 4 series.
+ * This version is designed for the linux kernel 2.4, 2.6, 3, 4 and 5 series.
*
* sgp_dd is a Posix threads specialization of the sg_dd utility. Both
* sgp_dd and sg_dd only perform special tasks when one or both of the given
@@ -84,7 +84,7 @@
#include "sg_pr2serr.h"
-static const char * version_str = "5.75 20200219";
+static const char * version_str = "5.76 20200510";
#define DEF_BLOCK_SIZE 512
#define DEF_BLOCKS_PER_TRANSFER 128
@@ -370,7 +370,7 @@ tsafe_strerror(int code, char * ebp)
* ISBN 0-201-63392-2 . [Highly recommended book.] Changed __FILE__
* to __func__ */
#define err_exit(code,text) do { \
- char strerr_buff[STRERR_BUFF_LEN]; \
+ char strerr_buff[STRERR_BUFF_LEN + 1]; \
pr2serr("%s at \"%s\":%d: %s\n", \
text, __func__, __LINE__, tsafe_strerror(code, strerr_buff)); \
exit(1); \
@@ -836,7 +836,7 @@ normal_in_operation(Rq_coll * clp, Rq_elem * rep, int blocks)
{
bool stop_after_write = false;
int res;
- char strerr_buff[STRERR_BUFF_LEN];
+ char strerr_buff[STRERR_BUFF_LEN + 1];
/* enters holding in_mutex */
while (((res = read(rep->infd, rep->buffp, blocks * clp->bs)) < 0) &&
@@ -882,7 +882,7 @@ static void
normal_out_operation(Rq_coll * clp, Rq_elem * rep, int blocks)
{
int res;
- char strerr_buff[STRERR_BUFF_LEN];
+ char strerr_buff[STRERR_BUFF_LEN + 1];
/* enters holding out_mutex */
while (((res = write(rep->outfd, rep->buffp, rep->num_blks * clp->bs))