aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2022-03-22 09:59:54 -0700
committerTony Luck <tony.luck@intel.com>2022-03-23 08:20:29 -0700
commit6b9ba1649d053505a67db5bc70f00a8d390cb553 (patch)
tree2cacabc26c37fddd5ebf07714914fff9587c2163
parente8b04612190b5fd221e4985ba6a02742543b99b1 (diff)
downloadras-tools-6b9ba1649d053505a67db5bc70f00a8d390cb553.tar.gz
einj_mem_uc: Fix parsing of available_error_types
Commit 38f47153c2c1 ("Check the injected error type available before write error type") didn't skip the extra text on the end of each line when checking whether a specific error type is supported. Reported-by: Liu Xinpeng <liuxp11@chinatelecom.cn> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--einj_mem_uc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/einj_mem_uc.c b/einj_mem_uc.c
index d42937c..e62f1f5 100644
--- a/einj_mem_uc.c
+++ b/einj_mem_uc.c
@@ -62,7 +62,7 @@ static int check_errortype_available(char *file, unsigned long long val)
exit(1);
}
- while (fscanf(fp, "%llx ", &available_error_type)) {
+ while (fscanf(fp, "%llx%*[^\n]", &available_error_type) == 1) {
if (val == available_error_type) {
ret = 0;
break;