X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fexfatprogs.git;a=blobdiff_plain;f=lib%2Flibexfat.c;fp=lib%2Flibexfat.c;h=4fd4ac6686e37dcf8a8aa0b6e5b2e1b7ee8019a5;hp=d7c1df1ca655d34400c30d9e5aef80e54f63d8dc;hb=0a7a8b470671035ad0c2d8dc0d7714d06921273d;hpb=03290761e3849db9b13d2d3b176b36ab31c395bb diff --git a/lib/libexfat.c b/lib/libexfat.c index d7c1df1..4fd4ac6 100644 --- a/lib/libexfat.c +++ b/lib/libexfat.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "exfat_ondisk.h" #include "libexfat.h" @@ -748,8 +749,7 @@ off_t exfat_s2o(struct exfat *exfat, off_t sect) off_t exfat_c2o(struct exfat *exfat, unsigned int clus) { - if (clus < EXFAT_FIRST_CLUSTER) - return ~0L; + assert(clus >= EXFAT_FIRST_CLUSTER); return exfat_s2o(exfat, le32_to_cpu(exfat->bs->bsx.clu_offset) + ((off_t)(clus - EXFAT_FIRST_CLUSTER) <<