diff --git a/sys/arch/powerpc/powerpc/ofw_machdep.c b/sys/arch/powerpc/powerpc/ofw_machdep.c index f437eb60a41e..7f235d3cc864 100644 --- a/sys/arch/powerpc/powerpc/ofw_machdep.c +++ b/sys/arch/powerpc/powerpc/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_machdep.c,v 1.6 2000/09/24 15:57:03 tsubai Exp $ */ +/* $NetBSD: ofw_machdep.c,v 1.7 2000/12/05 05:16:00 mycroft Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. @@ -76,12 +76,13 @@ mem_regions(memp, availp) /* Remove zero sized entry in the returned data. */ cnt /= sizeof OFmem[0]; - for (i = 0; i < cnt; i++) + for (i = 0; i < cnt; ) if (OFmem[i].size == 0) { bcopy(&OFmem[i + 1], &OFmem[i], (cnt - i) * sizeof OFmem[0]); cnt--; - } + } else + i++; bzero(OFavail, sizeof OFavail); cnt = OF_getprop(phandle, "available", @@ -90,12 +91,13 @@ mem_regions(memp, availp) goto error; cnt /= sizeof OFavail[0]; - for (i = 0; i < cnt; i++) + for (i = 0; i < cnt; ) if (OFavail[i].size == 0) { bcopy(&OFavail[i + 1], &OFavail[i], (cnt - i) * sizeof OFavail[0]); cnt--; - } + } else + i++; *memp = OFmem; *availp = OFavail;