diff options
| author | Keith Packard <keithp@keithp.com> | 2016-09-02 23:34:47 -0500 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2016-09-02 23:34:47 -0500 | 
| commit | 3ea30c1909b3ae23918ea6d0a53d2c4065b08763 (patch) | |
| tree | f06f7917dc908a8d23dc63e3a90065cb964333a9 | |
| parent | dfaabc1ca3aaad0d249283308b06d3e0567f0c59 (diff) | |
ao-tools/ao-usbload: Fix -f flag, remove debug hacks
The code to validate the usb id and product name had some debug hacks
left enabled, which caused it to fail. The short -f version of the
force flag was also not getting parsed correctly.
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | ao-tools/ao-usbload/ao-usbload.c | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/ao-tools/ao-usbload/ao-usbload.c b/ao-tools/ao-usbload/ao-usbload.c index d0579de1..758eb696 100644 --- a/ao-tools/ao-usbload/ao-usbload.c +++ b/ao-tools/ao-usbload/ao-usbload.c @@ -189,7 +189,7 @@ main (int argc, char **argv)  	int			has_flash_size = 0;  	int			force = 0; -	while ((c = getopt_long(argc, argv, "wrT:D:c:s:v:", options, NULL)) != -1) { +	while ((c = getopt_long(argc, argv, "wrfT:D:c:s:v:", options, NULL)) != -1) {  		switch (c) {  		case 'T':  			tty = optarg; @@ -400,7 +400,7 @@ main (int argc, char **argv)  			}  			new_len = ucs2len(new_product);  			old_len = ucs2len(old_product); -			if (1 || new_len != old_len || memcmp(new_product, old_product, new_len * 2) != 0) { +			if (new_len != old_len || memcmp(new_product, old_product, new_len * 2) != 0) {  				fprintf(stderr, "USB product mismatch (device is ");  				putucs2str(new_product, stderr);  				fprintf(stderr, ", image is "); @@ -413,7 +413,6 @@ main (int argc, char **argv)  		if (!ao_editaltos(load, serial, cal))  			done(cc, 1);  	} -	done(cc, 0);  	/* And flash the resulting image to the device  	 */ | 
