busybox/util-linux
Ron Yorston d840c5d139 libbb: add a function to make a copy of a region of memory
Introduce a library routine to package the idiom:

    p = xmalloc(b, n);
    memcpy(p, b, n);

and use it where possible.  The example in traceroute used xzalloc
but it didn't need to.

function                                             old     new   delta
xmemdup                                                -      32     +32
last_main                                            834     826      -8
make_device                                         2321    2311     -10
common_traceroute_main                              3698    3685     -13
readtoken1                                          3182    3168     -14
procps_scan                                         1222    1206     -16
forkchild                                            655     638     -17
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/6 up/down: 32/-78)            Total: -46 bytes

Signed-off-by: Ron Yorston <rmy@frippery.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-07-19 23:05:20 +02:00
..
volume_id volume_id: fix a buglet introduced by is_prefixed_with() conversion 2015-04-14 14:32:39 +02:00
acpid.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
blkid.c blkid: if parameters are given, do not scan /dev 2012-03-03 15:09:07 +01:00
blockdev.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
Config.src mount: -T OTHERTAB support 2015-03-11 16:07:24 +01:00
dmesg.c dmesg: handle multi-char log levels 2013-01-05 21:02:14 -05:00
fatattr.c fatattr: use the standard type for 32-bit int 2014-07-04 15:16:46 +02:00
fbset.c fbset: respect rgba configuration lines in fb.modes 2012-07-07 19:58:15 +02:00
fdformat.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
fdisk_aix.c *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
fdisk_gpt.c Make smart_ulltoa return pointer to end (allows for code shink in callers) 2013-09-06 12:53:14 +02:00
fdisk_osf.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
fdisk_sgi.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
fdisk_sun.c fdisk_sun: fix partition alignment 2013-02-11 00:22:59 +01:00
fdisk.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
findfs.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
flock.c whitespace fixes. no code changes 2013-01-14 01:34:48 +01:00
freeramdisk.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
fsck_minix.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
fstrim.c fstrim: fix help text 2015-02-04 15:19:38 +01:00
getopt.c getopt: improve help text; code shrink 2013-01-24 11:36:00 +01:00
hexdump.c Commonalize typical [b,]k,m suffix struct 2013-07-13 23:49:45 +02:00
hwclock.c Use chomp to remove newlines 2015-03-12 20:18:51 +01:00
ipcrm.c whitespace fixes. no code changes 2013-01-14 01:34:48 +01:00
ipcs.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
Kbuild.src fstrim: use new-style config/kbuild/applet snippets; trim help text 2013-11-12 12:09:14 +01:00
losetup.c losetup: assorted fixes. Closes 6314 2013-06-27 03:45:16 +02:00
lspci.c whitespace fixes. no code changes 2013-01-14 01:34:48 +01:00
lsusb.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
mdev.c libbb: add a function to make a copy of a region of memory 2015-07-19 23:05:20 +02:00
minix.h *: more portability fixes by Dan Fandrich 2009-09-23 23:15:43 +02:00
mkfs_ext2_test.sh mkfs_ext2: use compatible inode sizes; add -I <inodesize>. (by Vladimir) 2009-10-22 12:12:17 +02:00
mkfs_ext2.c mount: fix the wrongly stored fs creation time 2012-06-21 16:50:46 +02:00
mkfs_ext2.txt mkfs_ext2: use compatible inode sizes; add -I <inodesize>. (by Vladimir) 2009-10-22 12:12:17 +02:00
mkfs_minix.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
mkfs_reiser.c typo fixes 2015-05-25 13:46:36 +02:00
mkfs_vfat.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
mkswap.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
more.c *: better comments on termios manipulations. No code changes. 2012-01-15 23:00:13 +01:00
mount.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
pivot_root.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
rdate.c trivial code shrink 2015-02-18 13:47:46 +01:00
rdev.c *: style fixes. no code changes 2011-12-15 12:39:25 +01:00
readprofile.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
rev.c mass removal of underscores from _BB_DIR_foo and _BB_SUID_foo 2011-01-18 13:58:01 +01:00
rtcwake.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
script.c script: make it work even if fd 0 is closed 2014-03-16 12:34:53 +01:00
scriptreplay.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
setarch.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
swaponoff.c swaponoff: add support for -e 2015-01-05 20:35:00 +01:00
switch_root.c libbb: make xchroot do a chdir("/") after chroot 2012-03-08 00:28:24 +01:00
uevent.c uevent: new applet 2015-04-16 12:44:02 +02:00
umount.c umount: make -d always active, add -D to suppress it 2012-04-17 13:07:28 +02:00