]> www.infradead.org Git - mtd-utils.git/commitdiff
UBI Utils: Fix uninitialized written parameter
authorFrank Haverkamp <haver@vnet.ibm.com>
Fri, 16 Feb 2007 15:22:26 +0000 (16:22 +0100)
committerJosh Boyer <jwboyer@gmail.com>
Wed, 21 Feb 2007 13:23:19 +0000 (07:23 -0600)
The variable written was not properly initialized. That causes the
-j option to fail.

Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
ubi-utils/src/bin2nand.c

index 20fc90af2ce368d3f72cdd49dd42cf3cc0a9591a..7c4c816d10bc6cc775ce755f2d5fbda03085fa1c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) International Business Machines Corp., 2006
+ * Copyright (c) International Business Machines Corp., 2007
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@
  * 1.3 Padds data/oob to a given size. (oloh)
  * 1.4 Removed argp because we want to use uClibc.
  * 1.5 Minor cleanup
+ * 1.6 written variable not initialized (-j did not work) (haver)
  */
 
 #include <unistd.h>
@@ -46,7 +47,7 @@
 #include "config.h"
 #include "nandecc.h"
 
-#define PROGRAM_VERSION "1.5"
+#define PROGRAM_VERSION "1.6"
 
 #define CHECK_ENDP(option, endp) do {                  \
        if (*endp) {                                    \
@@ -248,7 +249,7 @@ int main (int argc, char** argv)
 {
        int rc = -1;
        int res = 0;
-       size_t written, read;
+       size_t written = 0, read;
        myargs args = {
                .action   = ACT_NORMAL,
                .pagesize = PAGESIZE,