Re: [Toybox] [PATCH] file: fix more '%' conversions than data arguments warning.

2018-09-21 Thread Rob Landley
On 09/17/2018 06:11 PM, enh wrote:
> Not sure how I messed this up, since both the toybox and Android build
> systems warn about this. (Android has -Werror, so at least it kept me
> from checking this in there.)

I fixed this on sunday, just forgot to push. (And I saw this email in the web
archive wednesday-ish, and today I fished it out of gmail's spam filter.)

> -xprintf("BMP image, %d x %d, %d bpp, %s\n", w, h, bpp);
> +xprintf("BMP image, %d x %d, %d bpp\n", w, h, bpp);

Same fix I did. I tried to figure out what argument to supply, but the ubuntu
"file" treats bmp as "data", so...

Speaking of which, I still want a bunch of tiny test files for this command. I
made a test bmp with "the gimp", and I can whip up a bunch of hello world ELF
files easily enough, but there's a lot of file types here...

Also, "tests/file.test" reading from "tests/files/file" is way too confusing,
and I'm open to suggestions. Really tests/*.test is kinda redundant already, and
having "file" under tests... Hmmm...

Maybe:

  test/scripts/{readlink,sed,rm...}
  test/files/{utf8,blkid,bzcat...}

Alternately, moving the files out of the "files" subdirectory and putting them
in with tests gives the ".test" suffix a reason to exist. (So tests/bzcat.test
and tests/bzcat/ would both be for bzcat...)

Sigh. Aesthetic decision. No emprically right answer. :P

Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


[Toybox] [PATCH] file: fix more '%' conversions than data arguments warning.

2018-09-17 Thread enh
Not sure how I messed this up, since both the toybox and Android build
systems warn about this. (Android has -Werror, so at least it kept me
from checking this in there.)
---
 toys/posix/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/posix/file.c b/toys/posix/file.c
index 4df0bc6..8d8d557 100644
--- a/toys/posix/file.c
+++ b/toys/posix/file.c
@@ -373,7 +373,7 @@ static void do_regular_file(int fd, char *name)
   } else if (len > 0x32 && !memcmp(s, "BM", 2) && !memcmp(s+6,
"\0\0\0\0", 4)) {
 int w = peek_le(s+0x12,4), h = peek_le(s+0x16,4), bpp = peek_le(s+0x1c,2);

-xprintf("BMP image, %d x %d, %d bpp, %s\n", w, h, bpp);
+xprintf("BMP image, %d x %d, %d bpp\n", w, h, bpp);
   } else {
 char *what = 0;
 int i, bytes;
-- 
2.19.0.397.gdd90340f6a-goog
From 63a86d9134bd8242c9dbe61eedcee1ea908ec4fe Mon Sep 17 00:00:00 2001
From: Elliott Hughes 
Date: Mon, 17 Sep 2018 16:09:03 -0700
Subject: [PATCH] file: fix more '%' conversions than data arguments warning.

Not sure how I messed this up, since both the toybox and Android build
systems warn about this. (Android has -Werror, so at least it kept me
from checking this in there.)
---
 toys/posix/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/posix/file.c b/toys/posix/file.c
index 4df0bc6..8d8d557 100644
--- a/toys/posix/file.c
+++ b/toys/posix/file.c
@@ -373,7 +373,7 @@ static void do_regular_file(int fd, char *name)
   } else if (len > 0x32 && !memcmp(s, "BM", 2) && !memcmp(s+6, "\0\0\0\0", 4)) {
 int w = peek_le(s+0x12,4), h = peek_le(s+0x16,4), bpp = peek_le(s+0x1c,2);
 
-xprintf("BMP image, %d x %d, %d bpp, %s\n", w, h, bpp);
+xprintf("BMP image, %d x %d, %d bpp\n", w, h, bpp);
   } else {
 char *what = 0;
 int i, bytes;
-- 
2.19.0.397.gdd90340f6a-goog

___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net