mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
qethqoat: Fix -Wrestrict warning
Get rid of the following GCC8 compile warning by using different buffers
for input/output:
qethqoat.c: In function ‘ebctoasc’:
qethqoat.c:51:30: warning: passing argument 2 to restrict-qualified
parameter aliases with argument 4 [-Wrestrict]
iconv(l_iconv_ebcdic_ascii, &inout, &len, &inout, &len);
^~~~~~ ~~~~~~
qethqoat.c:51:38: warning: passing argument 3 to restrict-qualified
parameter aliases with argument 5 [-Wrestrict]
iconv(l_iconv_ebcdic_ascii, &inout, &len, &inout, &len);
^~~~ ~~~~
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -47,9 +47,15 @@ static int mac_is_zero(__u8 *mac)
|
||||
return !(mac[0] | mac[1] | mac[2] | mac[3] | mac[4] | mac[5]);
|
||||
}
|
||||
|
||||
static void ebctoasc(char *inout, size_t len)
|
||||
static void ebctoasc(char *in, char *out, size_t size)
|
||||
{
|
||||
iconv(l_iconv_ebcdic_ascii, &inout, &len, &inout, &len);
|
||||
size_t size_out = size;
|
||||
size_t size_in = size;
|
||||
size_t rc;
|
||||
|
||||
rc = iconv(l_iconv_ebcdic_ascii, &in, &size_in, &out, &size_out);
|
||||
if (rc == (size_t) -1)
|
||||
fprintf(stderr, "Code page translation EBCDIC-ASCII failed\n");
|
||||
}
|
||||
|
||||
static void print_version()
|
||||
@@ -288,6 +294,7 @@ static void print_logical(struct qeth_qoat_logical *lhdr)
|
||||
char prouter[] = "primary";
|
||||
char srouter[] = "secondary";
|
||||
char nrouter[] = "no";
|
||||
char port_name[8];
|
||||
char *router;
|
||||
|
||||
if (lhdr->ip4_primary_router)
|
||||
@@ -341,8 +348,8 @@ static void print_logical(struct qeth_qoat_logical *lhdr)
|
||||
|
||||
|
||||
if (lhdr->port_name_f) {
|
||||
ebctoasc((char *)lhdr->port_name, 8);
|
||||
printf("Port name: %.8s\n", lhdr->port_name);
|
||||
ebctoasc((char *)lhdr->port_name, port_name, 8);
|
||||
printf("Port name: %.8s\n", port_name);
|
||||
}
|
||||
|
||||
printf("IPv4 assists enabled: 0x%08x\n", lhdr->ip4_ass_enabled);
|
||||
|
||||
Reference in New Issue
Block a user