[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 95dd6bb: Fix MS-Windows build following last change
From: |
Eli Zaretskii |
Subject: |
feature/native-comp 95dd6bb: Fix MS-Windows build following last change |
Date: |
Wed, 14 Apr 2021 10:29:17 -0400 (EDT) |
branch: feature/native-comp
commit 95dd6bb08038e31515568943dcfae13afac8ff70
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix MS-Windows build following last change
* src/emacs.c (real_filename) [WINDOWSNT]: Fix off-by-one error
when allocating storage for a file name.
---
src/emacs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/emacs.c b/src/emacs.c
index f0d75f5..a256564 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -450,16 +450,14 @@ real_filename (char *filename)
#ifdef WINDOWSNT
/* w32_my_exename resolves symlinks internally, so no need to
call realpath. */
- real_name = xmalloc (strlen (filename));
- strcpy (real_name, filename);
- return real_name;
+ real_name = xstrdup (filename);
#else
real_name = realpath (filename, NULL);
if (!real_name)
fatal ("could not resolve realpath of \"%s\": %s",
filename, strerror (errno));
- return real_name;
#endif
+ return real_name;
}
/* Set `invocation-name' `invocation-directory'. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- feature/native-comp 95dd6bb: Fix MS-Windows build following last change,
Eli Zaretskii <=