summaryrefslogtreecommitdiffstats
path: root/src/core/string.c
diff options
context:
space:
mode:
authorSimon Rettberg2026-01-28 12:53:53 +0100
committerSimon Rettberg2026-01-28 12:53:53 +0100
commit8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch)
treea8b359e59196be5b2e3862bed189107f4bc9975f /src/core/string.c
parentMerge branch 'master' into openslx (diff)
parent[prefix] Make unlzma.S compatible with 386 class CPUs (diff)
downloadipxe-openslx.tar.gz
ipxe-openslx.tar.xz
ipxe-openslx.zip
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/core/string.c')
-rw-r--r--src/core/string.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/core/string.c b/src/core/string.c
index 9a1b9b72a..2af19b7fe 100644
--- a/src/core/string.c
+++ b/src/core/string.c
@@ -22,6 +22,7 @@
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+FILE_SECBOOT ( PERMITTED );
#include <stddef.h>
#include <stdint.h>
@@ -321,9 +322,9 @@ char * strstr ( const char *haystack, const char *needle ) {
*
* @v dest Destination string
* @v src Source string
- * @ret dest Destination string
+ * @ret dnul Terminating NUL of destination string
*/
-char * strcpy ( char *dest, const char *src ) {
+char * stpcpy ( char *dest, const char *src ) {
const uint8_t *src_bytes = ( ( const uint8_t * ) src );
uint8_t *dest_bytes = ( ( uint8_t * ) dest );
@@ -333,6 +334,19 @@ char * strcpy ( char *dest, const char *src ) {
if ( ! *dest_bytes )
break;
}
+ return ( ( char * ) dest_bytes );
+}
+
+/**
+ * Copy string
+ *
+ * @v dest Destination string
+ * @v src Source string
+ * @ret dest Destination string
+ */
+char * strcpy ( char *dest, const char *src ) {
+
+ stpcpy ( dest, src );
return dest;
}