}
/* 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. */
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);