Commit 3f423c9c8fe197af5fa3b5945bc7d3f3ceec3512
1 parent
7f881e56
removed warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1871 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
3 additions
and
5 deletions
slirp/libslirp.h
| @@ -32,7 +32,7 @@ int slirp_add_exec(int do_pty, const char *args, int addr_low_byte, | @@ -32,7 +32,7 @@ int slirp_add_exec(int do_pty, const char *args, int addr_low_byte, | ||
| 32 | int guest_port); | 32 | int guest_port); |
| 33 | 33 | ||
| 34 | extern const char *tftp_prefix; | 34 | extern const char *tftp_prefix; |
| 35 | -extern const char slirp_hostname[33]; | 35 | +extern char slirp_hostname[33]; |
| 36 | 36 | ||
| 37 | #ifdef __cplusplus | 37 | #ifdef __cplusplus |
| 38 | } | 38 | } |
slirp/slirp.c
| @@ -25,7 +25,7 @@ struct ex_list *exec_list; | @@ -25,7 +25,7 @@ struct ex_list *exec_list; | ||
| 25 | /* XXX: suppress those select globals */ | 25 | /* XXX: suppress those select globals */ |
| 26 | fd_set *global_readfds, *global_writefds, *global_xfds; | 26 | fd_set *global_readfds, *global_writefds, *global_xfds; |
| 27 | 27 | ||
| 28 | -const char slirp_hostname[33]; | 28 | +char slirp_hostname[33]; |
| 29 | 29 | ||
| 30 | #ifdef _WIN32 | 30 | #ifdef _WIN32 |
| 31 | 31 |
vl.c
| @@ -3132,9 +3132,7 @@ int net_client_init(const char *str) | @@ -3132,9 +3132,7 @@ int net_client_init(const char *str) | ||
| 3132 | #ifdef CONFIG_SLIRP | 3132 | #ifdef CONFIG_SLIRP |
| 3133 | if (!strcmp(device, "user")) { | 3133 | if (!strcmp(device, "user")) { |
| 3134 | if (get_param_value(buf, sizeof(buf), "hostname", p)) { | 3134 | if (get_param_value(buf, sizeof(buf), "hostname", p)) { |
| 3135 | - if (strlen(buf) > 32) | ||
| 3136 | - buf[32] = 0; | ||
| 3137 | - strcpy(slirp_hostname, buf); | 3135 | + pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf); |
| 3138 | } | 3136 | } |
| 3139 | ret = net_slirp_init(vlan); | 3137 | ret = net_slirp_init(vlan); |
| 3140 | } else | 3138 | } else |