From: bluhm Date: Fri, 12 Aug 2022 16:42:54 +0000 (+0000) Subject: Fix non working continue in do while(0) loop. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f0452d1bec10770e08bd137d445665d8e2ef139;p=openbsd Fix non working continue in do while(0) loop. OK mvs@ jca@ CID 1519492 --- diff --git a/sys/net/if_media.c b/sys/net/if_media.c index 34beefcdfd5..31a888d5006 100644 --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_media.c,v 1.37 2022/08/05 13:57:16 bluhm Exp $ */ +/* $OpenBSD: if_media.c,v 1.38 2022/08/12 16:42:54 bluhm Exp $ */ /* $NetBSD: if_media.c,v 1.10 2000/03/13 23:52:39 soren Exp $ */ /*- @@ -338,7 +338,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, return (0); } - do { + while (1) { struct ifmedia_entry *ife; uint64_t *kptr; size_t ksiz; @@ -376,7 +376,8 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, error = copyout(kptr, ifmr->ifm_ulist, nwords * sizeof(*kptr)); free(kptr, M_TEMP, ksiz); - } while (0); + break; + } ifmr->ifm_count = nwords; break; }