The intention was to use vpninfo->hostname, by passing it as a parameter
to the create_ifname_w() function. But that function still just uses
vpninfo->ifname unconditionally, ignoring the argument. And causing the
crash in #370.
Fix up some bogus formatting while we're at it. We don't do open braces
on the same line as the function declaration.
Fixes: 48bd28aadd ("Use hostname as Wintun ifname (if ifname not specified)")
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
return ret;
}
-static intptr_t create_ifname_w(struct openconnect_info *vpninfo, const char *ifname) {
+static intptr_t create_ifname_w(struct openconnect_info *vpninfo,
+ const char *ifname)
+{
struct oc_text_buf *ifname_buf = buf_alloc();
- buf_append_utf16le(ifname_buf, vpninfo->ifname);
+
+ buf_append_utf16le(ifname_buf, ifname);
if (buf_error(ifname_buf)) {
vpn_progress(vpninfo, PRG_ERR, _("Could not construct interface name\n"));