diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-08-04 15:35:26 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-08-04 15:35:26 +0000 |
commit | cbde70fafd0ab9353e79b708621adf73420fdded (patch) | |
tree | 907f91f8803a78d13acf373658cc655ce99c1bc6 /src/sg_logs.c | |
parent | bfbefdf2d9aa12107d08d796d6fc78862ab85402 (diff) | |
download | sg3_utils-cbde70fafd0ab9353e79b708621adf73420fdded.tar.gz |
sg_ses: guard against small '--maxlen=' values
In several utilities guard against '--maxlen=' < 4 or < 16
as they seem to serve no useful purpose other than finding
awkward corner cases that may trip up these utilities.
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@908 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_logs.c')
-rw-r--r-- | src/sg_logs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sg_logs.c b/src/sg_logs.c index def65d24..bc93a7e0 100644 --- a/src/sg_logs.c +++ b/src/sg_logs.c @@ -36,7 +36,7 @@ #include "sg_unaligned.h" #include "sg_pr2serr.h" -static const char * version_str = "1.84 20210731"; /* spc6r05 + sbc5r01 */ +static const char * version_str = "1.85 20210802"; /* spc6r05 + sbc5r01 */ #define MX_ALLOC_LEN (0xfffc) #define SHORT_RESP_LEN 128 @@ -990,6 +990,9 @@ new_parse_cmd_line(struct opts_t * op, int argc, char * argv[]) "(inclusive) expected\n"); usage(2); return SG_LIB_SYNTAX_ERROR; + } else if (n < 4) { + pr2serr("Warning: setting '--maxlen' to 4\n"); + n = 4; } op->maxlen = n; break; |