[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1b94f800ae3: * exec/trace.c (rpl_stpcpy): Replace stpcpy if absen
From: |
Po Lu |
Subject: |
master 1b94f800ae3: * exec/trace.c (rpl_stpcpy): Replace stpcpy if absent. |
Date: |
Thu, 14 Mar 2024 02:22:05 -0400 (EDT) |
branch: master
commit 1b94f800ae34de5f4e72682a81de1d42bdda9276
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
* exec/trace.c (rpl_stpcpy): Replace stpcpy if absent.
---
exec/trace.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/exec/trace.c b/exec/trace.c
index 64dadc092c2..05d862f5b9f 100644
--- a/exec/trace.c
+++ b/exec/trace.c
@@ -895,6 +895,36 @@ handle_exec (struct exec_tracee *tracee, USER_REGS_STRUCT
*regs)
return 3;
}
+
+
+/* Define replacements for required string functions. */
+
+#if !defined HAVE_STPCPY || !defined HAVE_DECL_STPCPY
+
+/* Copy SRC to DEST, returning the address of the terminating '\0' in
+ DEST. */
+
+static char *
+rpl_stpcpy (char *dest, const char *src)
+{
+ register char *d;
+ register const char *s;
+
+ d = dest;
+ s = src;
+
+ do
+ *d++ = *s;
+ while (*s++ != '\0');
+
+ return d - 1;
+}
+
+#define stpcpy rpl_stpcpy
+#endif /* !defined HAVE_STPCPY || !defined HAVE_DECL_STPCPY */
+
+
+
/* Modify BUFFER, of size SIZE, so that it holds the absolute name of
the file identified by BUFFER, relative to the current working
directory of TRACEE if FD be AT_FDCWD, or the file referenced by FD
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 1b94f800ae3: * exec/trace.c (rpl_stpcpy): Replace stpcpy if absent.,
Po Lu <=