[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v3 18/25] s390x/3270: Let insert_IAC_escape_char() u
From: |
Philippe Mathieu-Daudé |
Subject: |
[qemu-s390x] [PATCH v3 18/25] s390x/3270: Let insert_IAC_escape_char() use size_t |
Date: |
Wed, 20 Feb 2019 02:02:25 +0100 |
This function takes size_t argument and return a size_t.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/char/terminal3270.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c
index 35b079d5c4..1cb48a3c6f 100644
--- a/hw/char/terminal3270.c
+++ b/hw/char/terminal3270.c
@@ -199,9 +199,10 @@ static int read_payload_3270(EmulatedCcw3270Device *dev)
}
/* TN3270 uses binary transmission, which needs escape IAC to IAC IAC */
-static int insert_IAC_escape_char(uint8_t *outv, int out_len)
+static size_t insert_IAC_escape_char(uint8_t *outv, size_t out_len)
{
- int IAC_num = 0, new_out_len, i, j;
+ size_t new_out_len;
+ int IAC_num = 0, i, j;
for (i = 0; i < out_len; i++) {
if (outv[i] == IAC) {
@@ -232,7 +233,7 @@ static int write_payload_3270(EmulatedCcw3270Device *dev,
uint8_t cmd)
int count = ccw_dstream_avail(get_cds(t));
int bound = (OUTPUT_BUFFER_SIZE - 3) / 2;
int len = MIN(count, bound);
- int out_len = 0;
+ size_t out_len = 0;
if (!t->handshake_done) {
if (!(t->outv[0] == IAC && t->outv[1] != IAC)) {
--
2.20.1
- Re: [qemu-s390x] [PATCH v3 23/25] hw/ipmi: Assert outlen > outpos, (continued)
- [qemu-s390x] [PATCH v3 16/25] tpm: Use size_t to hold sizes, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 18/25] s390x/3270: Let insert_IAC_escape_char() use size_t,
Philippe Mathieu-Daudé <=
- [qemu-s390x] [PATCH v3 21/25] s390x/sclp: Use size_t in process_mdb(), Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 22/25] s390x/sclp: Let write_console_data() take a size_t, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 24/25] chardev: Let qemu_chr_fe_write[_all] use size_t type argument, Philippe Mathieu-Daudé, 2019/02/19
- Re: [qemu-s390x] [PATCH v3 00/25] chardev: Convert qemu_chr_write() to take a size_t argument, Marc-André Lureau, 2019/02/20