summaryrefslogtreecommitdiffstats
path: root/src/dump.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-01-14 19:30:10 +0100
committerPali Rohár <pali.rohar@gmail.com>2013-01-14 19:30:10 +0100
commita6ec475a92ebfb9ab42685cb63b42a39656705ab (patch)
treee18051a5a7514511a72a52cb6dc57965c1b21d28 /src/dump.c
parent783222ed007f93d16bfb224df3d10ddb47bf4a74 (diff)
parenta6ef73359c0e0537ebf83795ebacbbfaee2c9c28 (diff)
download0xFFFF-a6ec475a92ebfb9ab42685cb63b42a39656705ab.tar.bz2
Merge branch 'pvc' into legacylegacy
Diffstat (limited to 'src/dump.c')
-rw-r--r--src/dump.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dump.c b/src/dump.c
index 9fc0a86..02025e5 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -69,17 +69,14 @@ __rf_extract_exit:
* This function was covardly copied from nanddump.c @ mtd-utils-20060907
*/
#define _GNU_SOURCE
-#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <sys/types.h>
-#include <sys/stat.h>
//#include <asm/types.h>
#include <mtd/mtd-user.h>
#ifndef loff_t
@@ -172,6 +169,9 @@ int check_badblocks(char *mtddev)
return 1;
}
+ memset(&stat1, 0, sizeof(stat1));
+ memset(&stat2, 0, sizeof(stat2));
+
fprintf(stderr, "Block size %u, page size %u, OOB size %u\n",
meminfo.erasesize, meminfo.writesize, meminfo.oobsize);
fprintf(stderr, "Size %u, flags %u, type 0x%x\n",
@@ -513,7 +513,7 @@ int dump_config()
break;
if (!memcmp(buf,"ConF", 4)) {
loop:
- read(fd, buf, 4);
+ ret = read(fd, buf, 4);
if (ret == -1) break;
printf("\n0x%08x : ConF %02x %02x %02x %02x : ", i,
buf[0], buf[1], buf[2], buf[3]);