aboutsummaryrefslogtreecommitdiffstats
path: root/Lessons_uncategorized
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2024-02-15 17:36:21 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2024-02-15 17:36:21 +0300
commit8f31f82568e9bced7f3307063785549651ea8906 (patch)
tree2104abfa005b70123bf788943bc878b041af0787 /Lessons_uncategorized
parentf19ebca21845c686f5e0fc88dc16628895fe2069 (diff)
downloadUEFI-Lessons-8f31f82568e9bced7f3307063785549651ea8906.tar.gz
UEFI-Lessons-8f31f82568e9bced7f3307063785549651ea8906.tar.bz2
UEFI-Lessons-8f31f82568e9bced7f3307063785549651ea8906.zip
Fix error with an empty string token
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'Lessons_uncategorized')
-rw-r--r--Lessons_uncategorized/Lesson_Varstore_5/README.md5
-rw-r--r--Lessons_uncategorized/Lesson_Varstore_5/UefiLessonsPkg/HIIFormDataElementsVarstore/HIIFormDataElementsVarstore.c5
-rw-r--r--Lessons_uncategorized/Lesson_Varstore_6/README.md5
3 files changed, 12 insertions, 3 deletions
diff --git a/Lessons_uncategorized/Lesson_Varstore_5/README.md b/Lessons_uncategorized/Lesson_Varstore_5/README.md
index 5892635..0ae98af 100644
--- a/Lessons_uncategorized/Lesson_Varstore_5/README.md
+++ b/Lessons_uncategorized/Lesson_Varstore_5/README.md
@@ -247,7 +247,10 @@ VOID DebugCallbackValue(UINT8 Type, EFI_IFR_TYPE_VALUE *Value)
DEBUG ((EFI_D_INFO, "%04d/%02d/%02d\n", Value->date.Year, Value->date.Month, Value->date.Day));
break;
case EFI_IFR_TYPE_STRING:
- DEBUG ((EFI_D_INFO, "%s\n", HiiGetString(mHiiHandle, Value->string, "en-US") ));
+ if (Value->string)
+ DEBUG ((EFI_D_INFO, "%s\n", HiiGetString(mHiiHandle, Value->string, "en-US") ));
+ else
+ DEBUG ((EFI_D_INFO, "NO STRING!\n" ));
break;
default:
DEBUG ((EFI_D_INFO, "Unknown\n" ));
diff --git a/Lessons_uncategorized/Lesson_Varstore_5/UefiLessonsPkg/HIIFormDataElementsVarstore/HIIFormDataElementsVarstore.c b/Lessons_uncategorized/Lesson_Varstore_5/UefiLessonsPkg/HIIFormDataElementsVarstore/HIIFormDataElementsVarstore.c
index 42af437..3804f0a 100644
--- a/Lessons_uncategorized/Lesson_Varstore_5/UefiLessonsPkg/HIIFormDataElementsVarstore/HIIFormDataElementsVarstore.c
+++ b/Lessons_uncategorized/Lesson_Varstore_5/UefiLessonsPkg/HIIFormDataElementsVarstore/HIIFormDataElementsVarstore.c
@@ -224,7 +224,10 @@ VOID DebugCallbackValue(UINT8 Type, EFI_IFR_TYPE_VALUE *Value)
DEBUG ((EFI_D_INFO, "%04d/%02d/%02d\n", Value->date.Year, Value->date.Month, Value->date.Day));
break;
case EFI_IFR_TYPE_STRING:
- DEBUG ((EFI_D_INFO, "%s\n", HiiGetString(mHiiHandle, Value->string, "en-US") ));
+ if (Value->string)
+ DEBUG ((EFI_D_INFO, "%s\n", HiiGetString(mHiiHandle, Value->string, "en-US") ));
+ else
+ DEBUG ((EFI_D_INFO, "NO STRING!\n" ));
break;
default:
DEBUG ((EFI_D_INFO, "Unknown\n" ));
diff --git a/Lessons_uncategorized/Lesson_Varstore_6/README.md b/Lessons_uncategorized/Lesson_Varstore_6/README.md
index a5f9236..b6af888 100644
--- a/Lessons_uncategorized/Lesson_Varstore_6/README.md
+++ b/Lessons_uncategorized/Lesson_Varstore_6/README.md
@@ -145,7 +145,10 @@ VOID CallbackValueToStr(UINT8 Type, EFI_IFR_TYPE_VALUE *Value, EFI_STRING* Value
UnicodeSPrint(*ValueStr, ValueStrSize, L"%04d/%02d/%02d", Value->date.Year, Value->date.Month, Value->date.Day);
break;
case EFI_IFR_TYPE_STRING:
- UnicodeSPrint(*ValueStr, ValueStrSize, L"%s", HiiGetString(mHiiHandle, Value->string, "en-US"));
+ if (Value->string)
+ UnicodeSPrint(*ValueStr, ValueStrSize, L"%s", HiiGetString(mHiiHandle, Value->string, "en-US"));
+ else
+ UnicodeSPrint(*ValueStr, ValueStrSize, L"NO STRING!");
break;
default:
UnicodeSPrint(*ValueStr, ValueStrSize, L"Unknown");