diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2022-04-11 19:24:56 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-04-12 14:39:01 +0000 |
commit | fab6285a73c4c73bb131792d0afb20be369082d1 (patch) | |
tree | c122cd7d53e7bef3c70d3021adcb267d80400a2e /CryptoPkg/Library/Include | |
parent | 03951e56457f18b022f574bacdc0cc2acc45dac2 (diff) | |
download | edk2-fab6285a73c4c73bb131792d0afb20be369082d1.zip edk2-fab6285a73c4c73bb131792d0afb20be369082d1.tar.gz edk2-fab6285a73c4c73bb131792d0afb20be369082d1.tar.bz2 |
CryptoPkg/CrtLibSupport: fix strcpy
strcpy() returns a pointer to the destination string, AsciiStrCpyS()
does not. So a simple #define does not work. Create a function
instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Diffstat (limited to 'CryptoPkg/Library/Include')
-rw-r--r-- | CryptoPkg/Library/Include/CrtLibSupport.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h index 287d7f7..bdc2654 100644 --- a/CryptoPkg/Library/Include/CrtLibSupport.h +++ b/CryptoPkg/Library/Include/CrtLibSupport.h @@ -395,6 +395,12 @@ inet_pton ( void *
);
+char *
+strcpy (
+ char *restrict strDest,
+ const char *strSource
+ );
+
//
// Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions
//
@@ -404,7 +410,6 @@ inet_pton ( #define memcmp(buf1, buf2, count) (int)(CompareMem(buf1,buf2,(UINTN)(count)))
#define memmove(dest, source, count) CopyMem(dest,source,(UINTN)(count))
#define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
-#define strcpy(strDest, strSource) AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource)
#define strncpy(strDest, strSource, count) AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)
#define strcat(strDest, strSource) AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)
#define strncmp(string1, string2, count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
|