From: Heiko Hund Date: Wed, 23 Mar 2022 15:43:41 +0100 Message-ID: <2629714.a3cCF2CB6G@...2664...> In-Reply-To: <20220323143452.1100446-1-heiko@...2662...> References: <20220308230621.1532809-1-heiko@...2662...> <20220323143452.1100446-1-heiko@...2662...> MIME-Version: 1.0 Subject: Re: [Openvpn-devel] [PATCH v3] add support for --dns option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: openvpn-devel@lists.sourceforge.net On Mittwoch, 23. M=C3=A4rz 2022 15:34:52 CET Heiko Hund wrote: > +static void > +setenv_dns_option(struct env_set *es, > + const char *format, int i, int j, > + const char *value) > +{ > + char name[64]; > + bool name_ok =3D false; > + > + if (j < 0) > + { > + name_ok =3D openvpn_snprintf(name, sizeof(name), format, i); > + } > + else > + { > + name_ok =3D openvpn_snprintf(name, sizeof(name), format, i, j); > + } > + > + if (!name_ok) > + { > + msg(M_WARN, "WARNING: dns option setenv name buffer overflow"); > + } > + > + setenv_str(es, name, value); > +} Here's the helper function Gert was asking for. It's somewhat special in ho= w=20 the 'j' parameter is handled, but since it's local and very specialized, I = can=20 live with that. Regards, Heiko