aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/example/ml/mnist.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/example/ml/mnist.c')
-rw-r--r--platform/linux-generic/example/ml/mnist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/linux-generic/example/ml/mnist.c b/platform/linux-generic/example/ml/mnist.c
index 4c1066302..28720a3fd 100644
--- a/platform/linux-generic/example/ml/mnist.c
+++ b/platform/linux-generic/example/ml/mnist.c
@@ -56,8 +56,8 @@ static int read_digit_csv(const char *file_name, uint8_t *expected_digit, float
size = ftell(digit_file);
rewind(digit_file);
- tmp = malloc(size);
- memset(tmp, 0, size);
+ tmp = malloc(size + 1);
+ memset(tmp, 0, size + 1);
num_elem = fread(tmp, size, 1, digit_file);
fclose(digit_file);