Skip to content

Commit

Permalink
use more standard "-o offset=X" syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
chipturner committed Mar 28, 2016
1 parent f5d1a27 commit 13dcd21
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
8 changes: 0 additions & 8 deletions fuseprivate.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ int sqfs_opt_proc(void *data, const char *arg, int key,
} else if (key == FUSE_OPT_KEY_OPT) {
if (strncmp(arg, "-h", 2) == 0 || strncmp(arg, "--h", 3) == 0)
sqfs_usage(opts->progname, true);
} else if (key == 1) {
errno = 0;
opts->offset = strtoul(arg + 9, NULL, 10);
if (!isdigit(arg[9]) || errno != 0) {
fprintf(stderr, "Invalid --offset\n");
return -1;
}
return 0;
}
return 1; /* Keep */
}
3 changes: 2 additions & 1 deletion hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "nonstd.h"

#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -270,7 +271,7 @@ int main(int argc, char *argv[]) {
int ret;

struct fuse_opt fuse_opts[] = {
FUSE_OPT_KEY("--offset=", 1),
{"offset=%u", offsetof(sqfs_opts, offset), 0},
FUSE_OPT_END
};

Expand Down
3 changes: 2 additions & 1 deletion ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <errno.h>
#include <float.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -399,7 +400,7 @@ int main(int argc, char *argv[]) {
int err;
sqfs_ll *ll;
struct fuse_opt fuse_opts[] = {
FUSE_OPT_KEY("--offset=", 1),
{"offset=%u", offsetof(sqfs_opts, offset), 0},
FUSE_OPT_END
};

Expand Down

0 comments on commit 13dcd21

Please sign in to comment.