X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fvolume_id%2Flib%2Ffat.c;h=e5a5cc119180b025b59225f7379640867508f309;hb=0565a00a4cfdabd325bf2e117620d5f15dd46cda;hp=759e106f6805c9d6399c64804f3df7badc4e56ac;hpb=2603474ff9be2418900581da1af5cccc9f13cae1;p=elogind.git diff --git a/extras/volume_id/lib/fat.c b/extras/volume_id/lib/fat.c index 759e106f6..e5a5cc119 100644 --- a/extras/volume_id/lib/fat.c +++ b/extras/volume_id/lib/fat.c @@ -4,19 +4,24 @@ * Copyright (C) 2004-2007 Kay Sievers * Copyright (C) 2007 Ryan Lortie * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif -#ifdef HAVE_CONFIG_H -# include -#endif - #include #include #include @@ -26,7 +31,6 @@ #include "libvolume_id.h" #include "libvolume_id-private.h" -#include "util.h" #define FAT12_MAX 0xff5 #define FAT16_MAX 0xfff5 @@ -271,7 +275,7 @@ int volume_id_probe_vfat(struct volume_id *id, uint64_t off, uint64_t size) int maxloop; size_t fnlen; - info("probing at offset 0x%llx\n", (unsigned long long) off); + info("probing at offset 0x%" PRIx64 "\n", off); buf = volume_id_get_buffer(id, off, 0x400); if (buf == NULL) @@ -376,7 +380,7 @@ magic: /* the label may be an attribute in the root directory */ root_start = (reserved + fat_size) * sector_size; - dbg("root dir start 0x%llx\n", (unsigned long long) root_start); + dbg("root dir start 0x%" PRIx64 "\n", root_start); root_dir_entries = le16_to_cpu(vs->dir_entries); dbg("expected entries 0x%x\n", root_dir_entries); @@ -438,7 +442,7 @@ fat32: dbg("next cluster %u\n", next); next_sect_off = (next - 2) * vs->sectors_per_cluster; next_off = (start_data_sect + next_sect_off) * sector_size; - dbg("cluster offset 0x%llx\n", (unsigned long long) next_off); + dbg("cluster offset 0x%" PRIx64 "\n", next_off); /* get cluster */ buf = volume_id_get_buffer(id, off + next_off, buf_size);