diff mbox series

[v3,18/25] s390x/3270: Let insert_IAC_escape_char() use size_t

Message ID 20190220010232.18731-19-philmd@redhat.com
State New
Headers show
Series chardev: Convert qemu_chr_write() to take a size_t argument | expand

Commit Message

Philippe Mathieu-Daudé Feb. 20, 2019, 1:02 a.m. UTC
This function takes size_t argument and return a size_t.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/char/terminal3270.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Cornelia Huck Feb. 20, 2019, 9:37 a.m. UTC | #1
On Wed, 20 Feb 2019 02:02:25 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> This function takes size_t argument and return a size_t.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/char/terminal3270.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
diff mbox series

Patch

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)) {