[issue1028] cpdup: not 64-bit clean

Joerg Sonnenberger joerg at britannica.bec.de
Wed Jun 11 13:28:51 PDT 2008


On Wed, Jun 11, 2008 at 08:17:38PM -0000, Michel Salim wrote:
> @@ -336,7 +336,7 @@
>      struct HCHead *head;
>      struct HCLeaf *item;
>      struct dirent *den;
> -    int desc = 0;
> +    size_t desc = 0;
>  
>      if (hc == NULL || hc->host == NULL)
>  	return(opendir(path));
> @@ -355,7 +355,7 @@
>  	}
>      }
>      if (hcc_get_descriptor(hc, desc, HC_DESC_DIR)) {
> -	fprintf(stderr, "hc_opendir: remote reused active descriptor %d\n",
> +	fprintf(stderr, "hc_opendir: remote reused active descriptor %zd\n",
>  		desc);
>  	return(NULL);
>      }

%zd or %zu?

> --- cpdup-1.11/fsmid.c.explicit_sizes	2008-05-22 19:05:08.000000000 -0400
> +++ cpdup-1.11/fsmid.c	2008-06-11 15:07:50.000000000 -0400
> @@ -35,8 +35,8 @@
>  
>  	    for (node = FSMIDBase; node; node = node->fid_Next) {
>  		if (node->fid_Accessed && node->fid_Code) {
> -		    fprintf(fo, "%016llx %d %s\n", 
> -			node->fid_Code, 
> +		    fprintf(fo, "%016llx %zd %s\n", 
> +			(long long unsigned)node->fid_Code, 
>  			strlen(node->fid_Name),
>  			node->fid_Name
>  		    );

(u)intmax_t + %jd/%ju is better here.

Joerg





More information about the Bugs mailing list