From: Michael Ablassmeier <abi@grinser.de>
To: stgt@vger.kernel.org
Subject: Re: [PATCH] VTL emulation, no barcodes shown in mtx
Date: Wed, 6 Jan 2021 23:28:42 +0100 [thread overview]
Message-ID: <20210106222842.f7wj3s4leywrg7m4@lrrr.dead-link.org> (raw)
In-Reply-To: <20210106220805.gztfmh7he76pwnci@lrrr.dead-link.org>
[-- Attachment #1: Type: text/plain, Size: 698 bytes --]
hi,
attached patch should fix this regression.
On Wed, Jan 06, 2021 at 11:08:05PM +0100, Michael Ablassmeier wrote:
> > commit 73cb8f355479d8f7cb402ca967b137d4a32c8f76
> > Author: FUJITA Tomonori <tomof@acm.org>
> > Date: Fri Jul 28 11:34:15 2017 +0900
> > smc: fix snprintf warnings with gcc7
>
> i reverted both commits and removed -WAll from the makefile to be
> able to compile, and now mtx show the barcodes:
>
> > Storage Changer /dev/sg8:1 Drives, 8 Slots ( 0 Import/Export )
> > Data Transfer Element 0:Empty
> > Storage Element 1:Full :VolumeTag=TAPE001
> > Storage Element 2:Full :VolumeTag=TAPE002
>
>
> bye,
> - michael
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 424 bytes --]
diff --git a/usr/smc.c b/usr/smc.c
index bbc7b7f..5efcbd7 100644
--- a/usr/smc.c
+++ b/usr/smc.c
@@ -184,7 +184,7 @@ static int add_element_descriptor(uint8_t *data, struct slot *s,
{
char buf[sizeof(attr->scsi_sn) + 1];
memset(buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf), "%-s", attr->scsi_sn);
+ snprintf(buf, sizeof(buf), "%-10s", attr->scsi_sn);
memcpy((char *)&data[i + 28], buf, 10);
}
}
next prev parent reply other threads:[~2021-01-06 22:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 18:58 VTL emulation, no barcodes shown in mtx Michael Ablassmeier
2021-01-06 19:01 ` Michael Ablassmeier
2021-01-06 22:08 ` Michael Ablassmeier
2021-01-06 22:28 ` Michael Ablassmeier [this message]
2021-01-06 22:41 ` [PATCH] " Michael Ablassmeier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210106222842.f7wj3s4leywrg7m4@lrrr.dead-link.org \
--to=abi@grinser.de \
--cc=stgt@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).