Mercurial > hg > toybox
changeset 442:ab2636878ba0
Use stpcpy() (posix 2008) for slight code shrink.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 08 Feb 2012 19:29:39 -0600 |
parents | fdb05e02b485 |
children | 41b5ac08208f |
files | lib/getmountlist.c |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/getmountlist.c Wed Feb 08 19:29:14 2012 -0600 +++ b/lib/getmountlist.c Wed Feb 08 19:29:39 2012 -0600 @@ -33,10 +33,8 @@ stat(me.mnt_dir, &(mt->stat)); statvfs(me.mnt_dir, &(mt->statvfs)); // Remember information from /proc/mounts - strcpy(mt->type, me.mnt_type); - mt->dir = mt->type + strlen(mt->type) + 1; - strcpy(mt->dir, me.mnt_dir); - mt->device = mt->dir + strlen(mt->dir) + 1; + mt->dir = stpcpy(mt->type, me.mnt_type) + 1; + mt->device = stpcpy(mt->dir, me.mnt_dir) + 1; strcpy(mt->device, me.mnt_fsname); mtlist = mt; }