From be43152d316c90a0c04aae1ed033ceaa69edbc72 Mon Sep 17 00:00:00 2001 From: Frank Haverkamp Date: Wed, 21 Jun 2006 15:07:46 +0200 Subject: [MTD] UBI: fixed bug in bin2nand introduced by the previous change. Signed-off-by: Frank Haverkamp --- ubi-utils/Makefile | 6 +++--- ubi-utils/src/bin2nand.c | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ubi-utils/Makefile b/ubi-utils/Makefile index 307da31..6161f3d 100644 --- a/ubi-utils/Makefile +++ b/ubi-utils/Makefile @@ -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 \ diff --git a/ubi-utils/src/bin2nand.c b/ubi-utils/src/bin2nand.c index 168f7dd..26d78de 100644 --- a/ubi-utils/src/bin2nand.c +++ b/ubi-utils/src/bin2nand.c @@ -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; } -- cgit v1.2.3