$NetBSD: patch-ab,v 1.1.1.1 2005/05/25 10:29:01 agc Exp $ --- recovery.c 2005/05/25 10:11:56 1.1 +++ recovery.c 2005/05/25 10:13:54 @@ -85,10 +85,18 @@ fname); chainlen = chain_length(clusts, cluster); +#if 0 reqd_clusts = size / bytes_per_clust; reqd_clusts += !!(size % bytes_per_clust); +#else + /* this doesn't assume !! returns 0 or 1 */ + reqd_clusts = (size + bytes_per_clust - 1) / bytes_per_clust; +#endif if (chainlen < reqd_clusts) { display(VERBOSE, log_carve, fname); + display(VERBOSE, "Need: %d got: %d Missing: %d bytes\n", + size, chainlen * bytes_per_clust, + size - (chainlen * bytes_per_clust)); carve_file(clusts, cluster, size, bytes_per_clust, file); return 0; }