diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-05-08 09:31:43 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-05-14 12:41:24 -0700 |
commit | aa907768af7ba9e29901d356cdcac6a436970323 (patch) | |
tree | 37b375fc862fad56969e14243bcd394d4a8e91b2 /toolbox/newfs_msdos.c | |
parent | 3fe8afa404a4317807c7116fdab40f2506713396 (diff) | |
download | core-aa907768af7ba9e29901d356cdcac6a436970323.tar.gz core-aa907768af7ba9e29901d356cdcac6a436970323.tar.bz2 core-aa907768af7ba9e29901d356cdcac6a436970323.zip |
toolbox: turn on -Werror
- Deal with some signedness issues
- Deal with some size issues
- Deal with NULL pointer issues
- Deal with some -Wunused issues
Change-Id: I1479dd90d690084491bae3475f2c547833519a57
Diffstat (limited to 'toolbox/newfs_msdos.c')
-rw-r--r-- | toolbox/newfs_msdos.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/toolbox/newfs_msdos.c b/toolbox/newfs_msdos.c index 27dca420b..30b9f772f 100644 --- a/toolbox/newfs_msdos.c +++ b/toolbox/newfs_msdos.c @@ -360,7 +360,7 @@ newfs_msdos_main(int argc, char *argv[]) if (!opt_create && !strchr(fname, '/')) { snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); if (!(fname = strdup(buf))) - err(1, NULL); + err(1, "%s", buf); } dtype = *argv; if (opt_create) { @@ -493,7 +493,7 @@ newfs_msdos_main(int argc, char *argv[]) if (!strchr(bname, '/')) { snprintf(buf, sizeof(buf), "/boot/%s", bname); if (!(bname = strdup(buf))) - err(1, NULL); + err(1, "%s", buf); } if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) err(1, "%s", bname); @@ -611,7 +611,7 @@ newfs_msdos_main(int argc, char *argv[]) now = tv.tv_sec; tm = localtime(&now); if (!(img = malloc(bpb.bps))) - err(1, NULL); + err(1, "%u", bpb.bps); dir = bpb.res + (bpb.spf ? bpb.spf : bpb.bspf) * bpb.nft; for (lsn = 0; lsn < dir + (fat == 32 ? bpb.spc : rds); lsn++) { x = lsn; @@ -728,14 +728,14 @@ newfs_msdos_main(int argc, char *argv[]) static void check_mounted(const char *fname, mode_t mode) { +#ifdef ANDROID + warnx("Skipping mount checks"); +#else struct statfs *mp; const char *s1, *s2; size_t len; int n, r; -#ifdef ANDROID - warnx("Skipping mount checks"); -#else if (!(n = getmntinfo(&mp, MNT_NOWAIT))) err(1, "getmntinfo"); len = strlen(_PATH_DEV); |