]> www.infradead.org Git - mtd-utils.git/commitdiff
[MTD] UBI: fixed bug in bin2nand introduced by the previous change.
authorFrank Haverkamp <haver@vnet.ibm.com>
Wed, 21 Jun 2006 13:07:46 +0000 (15:07 +0200)
committerFrank Haverkamp <haver@vnet.ibm.com>
Tue, 31 Oct 2006 14:06:06 +0000 (15:06 +0100)
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
ubi-utils/Makefile
ubi-utils/src/bin2nand.c

index 307da31245adaa2c407b727b09b26d885d8d299a..6161f3dda3abf927ed6a36686996cfb5471f22f4 100644 (file)
@@ -7,9 +7,9 @@ HOST_VERSION_NAME := $(shell uname -r)
 BUILD_CPU := $(shell uname -m)
 BUILD_OS := $(shell uname -o)
 
-KERNELHDR := ../include                # mtd-utils private headers
-DESTDIR := /usr/local          # default installation
-SBINDIR := bin                 # default directory for binaries
+KERNELHDR := ../include
+DESTDIR := /usr/local
+SBINDIR := bin
 
 CC := $(CROSS)gcc
 CFLAGS := -I./inc -I./src -I$(KERNELHDR) -O2 -g -Wall -Werror \
index 168f7dd803a70ebd7c2a776b1b4f3a684b95bb4a..26d78de549dc89176c1f58a87b974805d119a50c 100644 (file)
@@ -286,7 +286,7 @@ int main (int argc, char** argv)
                goto err;
        }
 
-       if (strcmp(args.file_out_data, "") != 0) {
+       if (args.file_out_data) {
                fp_out_data = fopen(args.file_out_data, "wb");
                if (fp_out_data == NULL) {
                        err_sys("Cannot open file %s for output\n",
@@ -295,7 +295,7 @@ int main (int argc, char** argv)
                }
        }
 
-       if (strcmp(args.file_out_oob, "") != 0) {
+       if (args.file_out_oob) {
                fp_out_oob = fopen(args.file_out_oob, "wb");
                if (fp_out_oob == NULL) {
                        err_sys("Cannot open file %s for output\n",
@@ -349,8 +349,10 @@ err:
 
        if (rc != 0) {
                err_msg("Error during conversion. rc: %d\n", rc);
-               remove(args.file_out_data);
-               remove(args.file_out_oob);
+               if (args.file_out_data)
+                       remove(args.file_out_data);
+               if (args.file_out_oob)
+                       remove(args.file_out_oob);
        }
        return rc;
 }