Commit 3f423c9c8fe197af5fa3b5945bc7d3f3ceec3512

Authored by bellard
1 parent 7f881e56

removed warnings


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1871 c046a42c-6fe2-441c-8c8c-71466251a162
slirp/libslirp.h
... ... @@ -32,7 +32,7 @@ int slirp_add_exec(int do_pty, const char *args, int addr_low_byte,
32 32 int guest_port);
33 33  
34 34 extern const char *tftp_prefix;
35   -extern const char slirp_hostname[33];
  35 +extern char slirp_hostname[33];
36 36  
37 37 #ifdef __cplusplus
38 38 }
... ...
slirp/slirp.c
... ... @@ -25,7 +25,7 @@ struct ex_list *exec_list;
25 25 /* XXX: suppress those select globals */
26 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 30 #ifdef _WIN32
31 31  
... ...
... ... @@ -3132,9 +3132,7 @@ int net_client_init(const char *str)
3132 3132 #ifdef CONFIG_SLIRP
3133 3133 if (!strcmp(device, "user")) {
3134 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 3137 ret = net_slirp_init(vlan);
3140 3138 } else
... ...