aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-07-01 20:29:39 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-07-01 20:29:39 +0000
commit3da6abd472200bc30b88d5a900ad316d9517d163 (patch)
tree993ad92dae87e2ff1bf015802d4b6150eddbd52f /net.c
parent97b35e359c7f063ef55a1db3c2e200ba431b44e3 (diff)
Use pstrcpy and pstrcat to avoid OpenBSD linker warning
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'net.c')
-rw-r--r--net.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net.c b/net.c
index 6d82d59c6e..001ebcbc84 100644
--- a/net.c
+++ b/net.c
@@ -2504,10 +2504,11 @@ int net_client_init(Monitor *mon, const char *device, const char *p)
goto out;
}
if (get_param_value(buf, sizeof(buf), "ip", p)) {
+ int vnet_buflen = strlen(buf) + strlen("/24") + 1;
/* emulate legacy parameter */
- vnet = qemu_malloc(strlen(buf) + strlen("/24") + 1);
- strcpy(vnet, buf);
- strcat(vnet, "/24");
+ vnet = qemu_malloc(vnet_buflen);
+ pstrcpy(vnet, vnet_buflen, buf);
+ pstrcat(vnet, vnet_buflen, "/24");
}
if (get_param_value(buf, sizeof(buf), "net", p)) {
vnet = qemu_strdup(buf);