On Fri, Jan 13, 2023 at 08:04:36PM +0100, Mathias Koehler wrote:
> I hope the following message is a format more helpful for you
> guys. (Thanks to Otto Moerbeek who gave me a hint.)
/% ... %./ is not a comment marker in C.
-Otto
> Again my question is how should that code look like?
> Because I can remove the 'if' and the code still does the same.
>
> ===================================================================
> RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
> retrieving revision 1.460
> diff -u -p -u -p -r1.460 ifconfig.c
> --- ifconfig.c 18 Dec 2022 18:56:38 -0000 1.460
> +++ ifconfig.c 13 Jan 2023 18:52:48 -0000
> @@ -1907,12 +1907,14 @@ delifjoinlist(const char *val, int d)
> memset(&join, 0, sizeof(join));
> join.i_flags |= (IEEE80211_JOIN_DEL | IEEE80211_JOIN_DEL_ALL);
>
> + /%
> if (d == -1) {
> ifr.ifr_data = (caddr_t)&join;
> if (ioctl(sock, SIOCS80211JOIN, (caddr_t)&ifr) == -1)
> err(1, "SIOCS80211JOIN");
> return;
> }
> + %/
>
> ifr.ifr_data = (caddr_t)&join;
> if (ioctl(sock, SIOCS80211JOIN, (caddr_t)&ifr) == -1)
>