]> git.eshelyaron.com Git - emacs.git/commit
Avoid stpncpy
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Aug 2023 19:50:15 +0000 (12:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Aug 2023 19:57:35 +0000 (12:57 -0700)
commit5315e6e8d7e7233d54cce2b4c1bc8cf3b7acf4dc
tree5dc35aa709e829e1a67dcb868e643eee85c3449a
parentf3868cb9d1806b35186eabc0262393316ebe689a
Avoid stpncpy

It’s not worth the porting hassle, and as the glibc manual says,
“this function is generally a poor choice for processing strings”.
* admin/merge-gnulib (GNULIB_MODULES): Remove stpncpy.
* exec/configure.ac: Do not check for stpncpy.
* exec/exec.c (rpl_stpncpy, stpncpy): Remove this replacement.
(exec_0): Properly clear buffer1.  Use memcpy instead of
stpncpy to add the trailing name.  This code is clearly
still suboptimal but efficiency is not that important here
and I tried to minimize the change.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
admin/merge-gnulib
exec/configure.ac
exec/exec.c
lib/gnulib.mk.in
lib/stpncpy.c [deleted file]
m4/gnulib-comp.m4
m4/stpncpy.m4 [deleted file]