Changeset View
Changeset View
Standalone View
Standalone View
lib/libfstyp/exfat.c
- This file was moved from usr.sbin/fstyp/exfat.c.
Show All 37 Lines | |||||
#endif | #endif | ||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "fstyp.h" | #include "fstyp.h" | ||||
#include "fstyp_p.h" | |||||
/* | /* | ||||
* https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification | * https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification | ||||
*/ | */ | ||||
struct exfat_vbr { | struct exfat_vbr { | ||||
char ev_jmp[3]; | char ev_jmp[3]; | ||||
char ev_fsname[8]; | char ev_fsname[8]; | ||||
▲ Show 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | fstyp_exfat(FILE *fp, char *label, size_t size) | ||||
*/ | */ | ||||
if (chksum != le32toh(cksect[0])) { | if (chksum != le32toh(cksect[0])) { | ||||
warnx("exfat: Found checksum 0x%08x != computed 0x%08x", | warnx("exfat: Found checksum 0x%08x != computed 0x%08x", | ||||
le32toh(cksect[0]), chksum); | le32toh(cksect[0]), chksum); | ||||
goto done; | goto done; | ||||
} | } | ||||
#ifdef WITH_ICONV | #ifdef WITH_ICONV | ||||
if (show_label) | if (encodings_enabled) | ||||
exfat_find_label(fp, ev, bytespersec, label, size); | exfat_find_label(fp, ev, bytespersec, label, size); | ||||
#endif | #endif | ||||
done: | done: | ||||
free(cksect); | free(cksect); | ||||
free(ev); | free(ev); | ||||
return (0); | return (0); | ||||
fail: | fail: | ||||
free(ev); | free(ev); | ||||
return (1); | return (1); | ||||
} | } |