[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-28 e5a49f44ff: * src/emacs.c (load_pdump): Fix use of xpalloc.
From: |
Andreas Schwab |
Subject: |
emacs-28 e5a49f44ff: * src/emacs.c (load_pdump): Fix use of xpalloc. |
Date: |
Sun, 2 Oct 2022 06:34:44 -0400 (EDT) |
branch: emacs-28
commit e5a49f44ffa66bcfa4b56b5fab088f7437b0ba9d
Author: Andreas Schwab <schwab@linux-m68k.org>
Commit: Andreas Schwab <schwab@linux-m68k.org>
* src/emacs.c (load_pdump): Fix use of xpalloc.
---
src/emacs.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/emacs.c b/src/emacs.c
index 602fa802e0..92779a8d0d 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -867,9 +867,8 @@ load_pdump (int argc, char **argv)
}
/* Where's our executable? */
- ptrdiff_t bufsize, exec_bufsize;
- emacs_executable = load_pdump_find_executable (argv[0], &bufsize);
- exec_bufsize = bufsize;
+ ptrdiff_t exec_bufsize, needed;
+ emacs_executable = load_pdump_find_executable (argv[0], &exec_bufsize);
/* If we couldn't find our executable, go straight to looking for
the dump in the hardcoded location. */
@@ -902,8 +901,8 @@ load_pdump (int argc, char **argv)
strip_suffix_length))
exenamelen = prefix_length;
}
- ptrdiff_t needed = exenamelen + strlen (suffix) + 1;
- dump_file = xpalloc (NULL, &bufsize, max (1, needed - bufsize), -1, 1);
+ ptrdiff_t bufsize = exenamelen + strlen (suffix) + 1;
+ dump_file = xpalloc (NULL, &bufsize, 1, -1, 1);
memcpy (dump_file, emacs_executable, exenamelen);
strcpy (dump_file + exenamelen, suffix);
result = pdumper_load (dump_file, emacs_executable);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-28 e5a49f44ff: * src/emacs.c (load_pdump): Fix use of xpalloc.,
Andreas Schwab <=