HEX format is friendly to iSCSI utils, for example:
./iscsi-inq -e 0x1 -c 0xb1 iscsi://...
atoi supports decimal only, this example does not work.
Use strtol(nptr, NULL, 0) to auto-detect format, then this works fine.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
According to the man page and help info, --debug=integer can specify the
debug_level, while it would report following error:
iscsi-inq --debug=2
iscsi-inq: option '--debug' doesn't allow an argument
It's because the iscsi-inq code did not handle this parameters
correctly. So here we just correct it.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Declare dynamically allocated strings as 'char *' instead of 'const char *'.
Remove the discard_const() macro. Do not test whether or not a pointer is
NULL before calling free() because it is allowed to pass NULL to free().
Signed-off-by: Bart Van Assche <bvanassche@acm.org>