fixing scale of symbol_size revealed logic error
authorMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Fri, 2 Mar 1990 17:26:08 +0000 (09:26 -0800)
committerMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Fri, 2 Mar 1990 17:26:08 +0000 (09:26 -0800)
SCCS-vsn: lib/libc/gen/nlist.c 5.6
SCCS-vsn: lib/libc/mips/gen/nlist.c 5.6

usr/src/lib/libc/gen/nlist.c
usr/src/lib/libc/mips/gen/nlist.c

index cd2bd7e..e6c792b 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)nlist.c    5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)nlist.c    5.6 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -80,7 +80,7 @@ nlist(name, list)
                goto done2;
        }
 
                goto done2;
        }
 
-       for (s = &nbuf; symbol_size -= sizeof(NLIST);) {
+       for (s = &nbuf; symbol_size; symbol_size -= sizeof(NLIST)) {
                if (fread((char *)s, sizeof(NLIST), 1, fsym) != 1)
                        goto done2;
                if (!s->_strx || s->n_type&N_STAB)
                if (fread((char *)s, sizeof(NLIST), 1, fsym) != 1)
                        goto done2;
                if (!s->_strx || s->n_type&N_STAB)
index cd2bd7e..e6c792b 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)nlist.c    5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)nlist.c    5.6 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -80,7 +80,7 @@ nlist(name, list)
                goto done2;
        }
 
                goto done2;
        }
 
-       for (s = &nbuf; symbol_size -= sizeof(NLIST);) {
+       for (s = &nbuf; symbol_size; symbol_size -= sizeof(NLIST)) {
                if (fread((char *)s, sizeof(NLIST), 1, fsym) != 1)
                        goto done2;
                if (!s->_strx || s->n_type&N_STAB)
                if (fread((char *)s, sizeof(NLIST), 1, fsym) != 1)
                        goto done2;
                if (!s->_strx || s->n_type&N_STAB)