summaryrefslogtreecommitdiff
path: root/ubi-utils/src/bin2nand.c
diff options
context:
space:
mode:
authorFrank Haverkamp <haver@vnet.ibm.com>2006-06-21 15:07:46 +0200
committerFrank Haverkamp <haver@vnet.ibm.com>2006-10-31 15:06:06 +0100
commitbe43152d316c90a0c04aae1ed033ceaa69edbc72 (patch)
tree209ff0cdea48b335bcdb4063ff644852d3366bc1 /ubi-utils/src/bin2nand.c
parent6ccd7242c4c1404dafb64cd937adc3c65ce02385 (diff)
[MTD] UBI: fixed bug in bin2nand introduced by the previous change.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Diffstat (limited to 'ubi-utils/src/bin2nand.c')
-rw-r--r--ubi-utils/src/bin2nand.c10
1 files changed, 6 insertions, 4 deletions
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;
}