diff -uNr -r sleuthkit-2.08-orig/src/fstools/fscheck.c sleuthkit-2.08/src/fstools/fscheck.c --- sleuthkit-2.08-orig/src/fstools/fscheck.c 2007-03-13 21:05:37.000000000 +0100 +++ sleuthkit-2.08/src/fstools/fscheck.c 2007-04-11 18:03:00.000000000 +0200 @@ -11,8 +11,10 @@ ** This software is distributed under the Common Public License 1.0 ** */ +#include #include "fs_tools.h" +static TSK_TCHAR *progname; static void usage() @@ -36,58 +38,71 @@ int main(int argc, char **argv) { - char *fstype = NULL; + TSK_TCHAR *fstype = NULL; int ch; - FS_INFO *fs; - char *imgtype = NULL, *imgoff = NULL; - IMG_INFO *img; + TSK_FS_INFO *fs; + TSK_TCHAR *imgtype = NULL; + SSIZE_T imgoff = 0; + TSK_IMG_INFO *img; progname = argv[0]; + setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "f:i:o:vV")) > 0) { + while ((ch = getopt(argc, argv, _TSK_T("f:i:o:vV"))) > 0) { switch (ch) { - case '?': + case _TSK_T('?'): default: - fprintf(stderr, "Invalid argument: %s\n", argv[optind]); + fprintf(stderr, _TSK_T("Invalid argument: %s\n"), argv[optind]); usage(); - case 'f': + case _TSK_T('f'): fstype = optarg; + if (TSTRCMP(fstype, _TSK_T("list")) == 0) { + tsk_fs_print_types(stderr); + exit(1); + } break; - case 'i': + case _TSK_T('i'): imgtype = optarg; + if (TSTRCMP(imgtype, _TSK_T("list")) == 0) { + tsk_img_print_types(stderr); + exit(1); + } break; - case 'o': - imgoff = optarg; + case _TSK_T('o'): + if ((imgoff = tsk_parse_offset(optarg)) == -1) { + tsk_error_print(stderr); + exit(1); + } break; - case 'v': - verbose++; + case _TSK_T('v'): + tsk_verbose++; break; - case 'V': - print_version(stdout); + case _TSK_T('V'): + tsk_print_version(stdout); exit(0); } } /* We need at least one more argument */ if (optind >= argc) { - fprintf(stderr, "Missing image name\n"); + tsk_fprintf(stderr, "Missing image name\n"); usage(); } img = - img_open(imgtype, imgoff, argc - optind, - (const char **) &argv[optind]); + tsk_img_open(imgtype, argc - optind, + (const TSK_TCHAR **) &argv[optind]); if (img == NULL) { tsk_error_print(stderr); exit(1); } - if (fs = fs_open(img, fstype)) { + if (fs = tsk_fs_open(img, imgoff, fstype)) { if (tsk_errno == TSK_ERR_FS_UNSUPTYPE) tsk_print_types(stderr);