don't increment/change a void *, cast to char * (thanks GCC!)
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 10 Jul 1993 08:59:34 +0000 (00:59 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 10 Jul 1993 08:59:34 +0000 (00:59 -0800)
SCCS-vsn: lib/libc/db/hash/hash.c 8.2

usr/src/lib/libc/db/hash/hash.c

index f41d2f3..1cf2877 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)hash.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)hash.c     8.2 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
@@ -839,7 +839,7 @@ hash_realloc(p_ptr, oldsize, newsize)
 
        if (p = malloc(newsize)) {
                memmove(p, *p_ptr, oldsize);
 
        if (p = malloc(newsize)) {
                memmove(p, *p_ptr, oldsize);
-               memset(p + oldsize, 0, newsize - oldsize);
+               memset((char *)p + oldsize, 0, newsize - oldsize);
                free(*p_ptr);
                *p_ptr = p;
        }
                free(*p_ptr);
                *p_ptr = p;
        }