From 92692f0fb974b0d851efa7446aaa7f57bb90408a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=B1=E7=BF=94=E7=9A=84=E9=BB=91=E9=B9=B0?= <53703887+AXDHY@users.noreply.github.com> Date: Fri, 10 Mar 2023 17:35:09 +0800 Subject: [PATCH] Fix a small bug about Access out of Bounds This is a small bug while coding, but it will cause strange exception while running by VS2022, which may have more strict check about access out of bounds. --- src/IrisDatasetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IrisDatasetTest.cpp b/src/IrisDatasetTest.cpp index af6ef35d9..1be17c650 100644 --- a/src/IrisDatasetTest.cpp +++ b/src/IrisDatasetTest.cpp @@ -63,7 +63,7 @@ bool load_data(int *samples, double *p = &((*input)[0]) + i * input_size; double *c = &((*iris_class)[0]) + i * number_classes; for (int k = 0; k < number_classes; k++) { - c[i] = 0.0; + c[k] = 0.0; } fgets(line, 1024, in);