symbol_size units are bytes, not struct nlists
authorMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Fri, 23 Feb 1990 06:37:34 +0000 (22:37 -0800)
committerMarc Teitelbaum <marc@ucbvax.Berkeley.EDU>
Fri, 23 Feb 1990 06:37:34 +0000 (22:37 -0800)
SCCS-vsn: lib/libc/gen/nlist.c 5.5
SCCS-vsn: lib/libc/mips/gen/nlist.c 5.5

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

index c4701fc..cd2bd7e 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)nlist.c    5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)nlist.c    5.5 (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--;) {
+       for (s = &nbuf; 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 c4701fc..cd2bd7e 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)nlist.c    5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)nlist.c    5.5 (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--;) {
+       for (s = &nbuf; 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)