Subject: RE: bin/29434
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Max Okumoto <okumoto@ucsd.edu>
List: netbsd-bugs
Date: 02/18/2005 00:54:01
The following reply was made to PR bin/29434; it has been noted by GNATS.

From: Max Okumoto <okumoto@ucsd.edu>
To: gnats-bugs@netbsd.org
Cc: 
Subject: RE: bin/29434
Date: Thu, 17 Feb 2005 16:53:56 -0800

 This is a multi-part message in MIME format.
 --------------070009000302020703030706
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Update to pr with patch
 
 --------------070009000302020703030706
 Content-Type: text/plain;
  name="p4"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="p4"
 
 diff -ru  nbsd-src/make.orig/arch.c nbsd-src/make/arch.c
 --- nbsd-src/make.orig/arch.c	Thu Feb 17 13:46:15 2005
 +++ nbsd-src/make/arch.c	Thu Feb 17 13:47:45 2005
 @@ -615,8 +615,8 @@
      Hash_InitTable(&ar->members, -1);
      memName[AR_MAX_NAME_LEN] = '\0';
  
 -    while (fread ((char *)&arh, sizeof (struct ar_hdr), 1, arch) == 1) {
 -	if (strncmp ( arh.ar_fmag, ARFMAG, sizeof (arh.ar_fmag)) != 0) {
 +    while (fread ((char *)&arh, sizeof(struct ar_hdr), 1, arch) == 1) {
 +	if (strncmp ( arh.ar_fmag, ARFMAG, sizeof(arh.ar_fmag)) != 0) {
  	    /*
  	     * The header is bogus, so the archive is bad
  	     * and there's no way we can recover...
 @@ -684,9 +684,9 @@
  #endif
  
  	    he = Hash_CreateEntry(&ar->members, memName, (Boolean *)NULL);
 -	    Hash_SetValue (he, emalloc (sizeof (struct ar_hdr)));
 +	    Hash_SetValue (he, emalloc (sizeof(struct ar_hdr)));
  	    memcpy ((Address)Hash_GetValue (he), (Address)&arh,
 -		sizeof (struct ar_hdr));
 +		sizeof(struct ar_hdr));
  	}
  	fseek (arch, (size + 1) & ~1, SEEK_CUR);
      }
 @@ -878,12 +878,12 @@
  	member = cp + 1;
      }
      len = tlen = strlen (member);
 -    if (len > sizeof (arhPtr->ar_name)) {
 -	tlen = sizeof (arhPtr->ar_name);
 +    if (len > sizeof(arhPtr->ar_name)) {
 +	tlen = sizeof(arhPtr->ar_name);
      }
  
 -    while (fread ((char *)arhPtr, sizeof (struct ar_hdr), 1, arch) == 1) {
 -	if (strncmp(arhPtr->ar_fmag, ARFMAG, sizeof (arhPtr->ar_fmag) ) != 0) {
 +    while (fread ((char *)arhPtr, sizeof(struct ar_hdr), 1, arch) == 1) {
 +	if (strncmp(arhPtr->ar_fmag, ARFMAG, sizeof(arhPtr->ar_fmag) ) != 0) {
  	     /*
  	      * The header is bogus, so the archive is bad
  	      * and there's no way we can recover...
 @@ -1003,7 +1003,7 @@
      snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now);
  
      if (arch != (FILE *) NULL) {
 -	(void)fwrite ((char *)&arh, sizeof (struct ar_hdr), 1, arch);
 +	(void)fwrite ((char *)&arh, sizeof(struct ar_hdr), 1, arch);
  	fclose (arch);
      }
  }
 @@ -1042,7 +1042,7 @@
      snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now);
  
      if (arch != (FILE *) NULL) {
 -	(void)fwrite ((char *)&arh, sizeof (struct ar_hdr), 1, arch);
 +	(void)fwrite ((char *)&arh, sizeof(struct ar_hdr), 1, arch);
  	fclose (arch);
  
  	times.actime = times.modtime = now;
 diff -ru  nbsd-src/make.orig/hash.h nbsd-src/make/hash.h
 --- nbsd-src/make.orig/hash.h	Thu Feb 17 13:46:12 2005
 +++ nbsd-src/make/hash.h	Thu Feb 17 13:47:51 2005
 @@ -134,7 +134,7 @@
   * Hash_Size(n) returns the number of words in an object of n bytes
   */
  
 -#define	Hash_Size(n)	(((n) + sizeof (int) - 1) / sizeof (int))
 +#define	Hash_Size(n)	(((n) + sizeof(int) - 1) / sizeof(int))
  
  void Hash_InitTable(Hash_Table *, int);
  void Hash_DeleteTable(Hash_Table *);
 diff -ru  nbsd-src/make.orig/parse.c nbsd-src/make/parse.c
 --- nbsd-src/make.orig/parse.c	Thu Feb 17 13:46:13 2005
 +++ nbsd-src/make/parse.c	Thu Feb 17 13:49:37 2005
 @@ -1992,7 +1992,7 @@
       */
      oldFile = emalloc(sizeof(IFile));
  
 -    memcpy(oldFile, &curFile, sizeof (IFile));
 +    memcpy(oldFile, &curFile, sizeof(IFile));
  
      (void) Lst_AtFront(includes, (ClientData)oldFile);
  
 @@ -2075,7 +2075,7 @@
  	(void) fprintf(stderr, "%s\n---- at line %d\n", str, lineno);
  
      oldFile = emalloc(sizeof(IFile));
 -    memcpy(oldFile, &curFile, sizeof (IFile));
 +    memcpy(oldFile, &curFile, sizeof(IFile));
  
      (void) Lst_AtFront(includes, (ClientData)oldFile);
  
 @@ -2217,7 +2217,7 @@
  	 * a very nice stack to track how we got here...
  	 */
  	oldFile = emalloc(sizeof(IFile));
 -	memcpy(oldFile, &curFile, sizeof (IFile));
 +	memcpy(oldFile, &curFile, sizeof(IFile));
  
  	(void) Lst_AtFront(includes, (ClientData)oldFile);
  
 @@ -2283,7 +2283,7 @@
  	free((Address) curFile.P);
      }
  
 -    memcpy(&curFile, ifile, sizeof (IFile));
 +    memcpy(&curFile, ifile, sizeof(IFile));
  
      free ((Address)ifile);
  
 diff -ru  nbsd-src/make.orig/targ.c nbsd-src/make/targ.c
 --- nbsd-src/make.orig/targ.c	Thu Feb 17 13:46:13 2005
 +++ nbsd-src/make/targ.c	Thu Feb 17 13:49:45 2005
 @@ -546,7 +546,7 @@
      static char	  	buf[128];
  
      parts = localtime(&tm);
 -    (void)strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts);
 +    (void)strftime(buf, sizeof(buf), "%k:%M:%S %b %d, %Y", parts);
      return(buf);
  }
 
 --------------070009000302020703030706--