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
slirp/slirp.c
vl.c
... | ... | @@ -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 | ... | ... |