X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FString.c;h=86828e65fc2af52d4619c2d261311d2f2e242874;hp=fb39a22a425203fade7ad03d2770b9a21054d057;hb=6cfb0c24a8c22b1379f72f089334112b3d271f9a;hpb=27f019223ce264f77c6db57a38018c46c6cb7a04 diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index fb39a22a42..86828e65fc 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -116,7 +116,7 @@ StrnCpy ( ReturnValue = Destination; - while ((*Source != L'\0') && (Length > 1)) { + while ((*Source != L'\0') && (Length > 0)) { *(Destination++) = *(Source++); Length--; } @@ -481,7 +481,7 @@ AsciiStrnCpy ( ReturnValue = Destination; - while (*Source && Length > 1) { + while (*Source && Length > 0) { *(Destination++) = *(Source++); Length--; }