From 0c9da05e5c053f09ca495287c7e34652e41eb00c Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 30 Apr 2006 21:34:14 +0000 Subject: [PATCH] removed warnings --- slirp/libslirp.h | 2 +- slirp/slirp.c | 2 +- vl.c | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/slirp/libslirp.h b/slirp/libslirp.h index 36c8ec21..a9260afe 100644 --- a/slirp/libslirp.h +++ b/slirp/libslirp.h @@ -32,7 +32,7 @@ int slirp_add_exec(int do_pty, const char *args, int addr_low_byte, int guest_port); extern const char *tftp_prefix; -extern const char slirp_hostname[33]; +extern char slirp_hostname[33]; #ifdef __cplusplus } diff --git a/slirp/slirp.c b/slirp/slirp.c index b4ab12a0..1331d0ea 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -25,7 +25,7 @@ struct ex_list *exec_list; /* XXX: suppress those select globals */ fd_set *global_readfds, *global_writefds, *global_xfds; -const char slirp_hostname[33]; +char slirp_hostname[33]; #ifdef _WIN32 diff --git a/vl.c b/vl.c index 64fcfb45..bfc14902 100644 --- a/vl.c +++ b/vl.c @@ -3132,9 +3132,7 @@ int net_client_init(const char *str) #ifdef CONFIG_SLIRP if (!strcmp(device, "user")) { if (get_param_value(buf, sizeof(buf), "hostname", p)) { - if (strlen(buf) > 32) - buf[32] = 0; - strcpy(slirp_hostname, buf); + pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf); } ret = net_slirp_init(vlan); } else -- 2.39.5