diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-01 22:16:01 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-01 22:16:01 +0000 |
commit | ae724571beb0cff6edefe42942b7cdc7aa81ee94 (patch) | |
tree | aebe447e031e49a703e77503dec70dcaf46bed30 /ShellPkg/Library/UefiShellDebug1CommandsLib/Edit | |
parent | 5f2915f59380777728344bbbca587d4944f19ed0 (diff) | |
download | edk2-platforms-ae724571beb0cff6edefe42942b7cdc7aa81ee94.tar.xz |
Comment's added and fixed.
Pointer's checked for NULL before access and after memory allocations.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11499 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/Edit')
-rw-r--r-- | ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c | 12 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c | 7 |
2 files changed, 9 insertions, 10 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c index fcd0de5cb5..8223847924 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c @@ -357,7 +357,7 @@ FileBufferRestoreMousePosition ( CurrentLine = FileBuffer.CurrentLine;
Line = MoveLine (FRow - FileBuffer.FilePosition.Row);
- if (FColumn > Line->Size) {
+ if (Line == NULL || FColumn > Line->Size) {
HasCharacter = FALSE;
}
@@ -1367,7 +1367,7 @@ GetNewLine ( Change a Unicode string to an ASCII string.
@param[in] UStr The Unicode string.
- @param[in] Lenght The maximum size of AStr.
+ @param[in] Length The maximum size of AStr.
@param[out] AStr ASCII string to pass out.
@return The actuall length.
@@ -1375,9 +1375,9 @@ GetNewLine ( UINTN
EFIAPI
UnicodeToAscii (
- IN CONST CHAR16 *UStr,
- IN CONST UINTN Length,
- OUT CHAR8 *AStr
+ IN CONST CHAR16 *UStr,
+ IN CONST UINTN Length,
+ OUT CHAR8 *AStr
)
{
UINTN Index;
@@ -1621,7 +1621,7 @@ FileBufferSave ( //
// now everything is ready , you can set the new file name to filebuffer
//
- if (StrCmp (FileName, FileBuffer.FileName) != 0) {
+ if (FileName != NULL && FileBuffer.FileName != NULL && StrCmp (FileName, FileBuffer.FileName) != 0) {
//
// not the same
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c index a82fdb9bb8..713332ea0d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c @@ -91,7 +91,7 @@ MainCommandSearch ( VOID
);
-/*
+/**
search string in file buffer, and replace it with another str
@retval EFI_SUCCESS The operation was successful.
@@ -589,8 +589,8 @@ MainCommandSearch ( return EFI_SUCCESS;
}
-/*
- search string in file buffer, and replace it with another str
+/**
+ Search string in file buffer, and replace it with another str.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@@ -1589,7 +1589,6 @@ GetTextY ( @retval EFI_SUCCESS The operation was successful.
@retval EFI_NOT_FOUND There was no mouse support found.
**/
-STATIC
EFI_STATUS
EFIAPI
MainEditorHandleMouseInput (
|