aboutsummaryrefslogtreecommitdiff
path: root/src/sg_verify.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2007-09-19 13:48:40 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2007-09-19 13:48:40 +0000
commitb6bc9ee42522285a70bcb1a4b81f052cc1c08bf6 (patch)
tree502c25bb85251fb8215a4305920ff004c6dcf2ad /src/sg_verify.c
parentb28016b015c62fc9a94828aaea10a394112ee1be (diff)
downloadsg3_utils-b6bc9ee42522285a70bcb1a4b81f052cc1c08bf6.tar.gz
sg_stpg work, device_name simplification, restore sg_read_buffer to build
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@103 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_verify.c')
-rw-r--r--src/sg_verify.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/sg_verify.c b/src/sg_verify.c
index b5de97b0..58b93fcf 100644
--- a/src/sg_verify.c
+++ b/src/sg_verify.c
@@ -48,7 +48,7 @@
* This program issues the SCSI VERIFY command to the given SCSI block device.
*/
-static char * version_str = "1.09 20070714";
+static char * version_str = "1.10 20070919";
#define ME "sg_verify: "
@@ -98,11 +98,10 @@ int main(int argc, char * argv[])
unsigned long long lba = 0;
unsigned long long orig_lba;
int verbose = 0;
- char device_name[256];
+ const char * device_name = NULL;
int ret = 0;
unsigned long info = 0;
- memset(device_name, 0, sizeof device_name);
while (1) {
int option_index = 0;
@@ -154,9 +153,8 @@ int main(int argc, char * argv[])
}
}
if (optind < argc) {
- if ('\0' == device_name[0]) {
- strncpy(device_name, argv[optind], sizeof(device_name) - 1);
- device_name[sizeof(device_name) - 1] = '\0';
+ if (NULL == device_name) {
+ device_name = argv[optind];
++optind;
}
if (optind < argc) {
@@ -180,7 +178,7 @@ int main(int argc, char * argv[])
orig_count = count;
orig_lba = lba;
- if (0 == device_name[0]) {
+ if (NULL == device_name) {
fprintf(stderr, "missing device name!\n");
usage();
return SG_LIB_SYNTAX_ERROR;