aboutsummaryrefslogtreecommitdiff
path: root/sg_simple3.c
diff options
context:
space:
mode:
Diffstat (limited to 'sg_simple3.c')
-rw-r--r--sg_simple3.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sg_simple3.c b/sg_simple3.c
index dc52b665..3abec270 100644
--- a/sg_simple3.c
+++ b/sg_simple3.c
@@ -25,7 +25,7 @@
Invocation: sg_simple3 [-x] <sg_device>
- Version 03.56 (20000323)
+ Version 03.57 (20020113)
6 byte INQUIRY command:
[0x12][ |lu][pg cde][res ][al len][cntrl ]
@@ -43,6 +43,8 @@
#define INQ_CMD_LEN 6
#define TUR_CMD_LEN 6
+#define EBUFF_SZ 256
+
int main(int argc, char * argv[])
{
int sg_fd, k, ok;
@@ -57,7 +59,7 @@ int main(int argc, char * argv[])
char inqPRevBuff[INQ_REPLY_PREV_LEN];
sg_io_hdr_t io_hdr;
char * file_name = 0;
- char ebuff[128];
+ char ebuff[EBUFF_SZ];
unsigned char sense_buffer[32];
int do_extra = 0;
@@ -83,7 +85,8 @@ int main(int argc, char * argv[])
}
if ((sg_fd = open(file_name, O_RDONLY)) < 0) {
- sprintf(ebuff, "sg_simple3: error opening file: %s", file_name);
+ snprintf(ebuff, EBUFF_SZ,
+ "sg_simple3: error opening file: %s", file_name);
perror(ebuff);
return 1;
}