From 4cd7d19d653eaacff1da3b13eefac3938e888b3d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 8 Feb 2012 19:29:39 -0600 Subject: Use stpcpy() (posix 2008) for slight code shrink. --- lib/getmountlist.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/getmountlist.c b/lib/getmountlist.c index 8410a923..1b235446 100644 --- a/lib/getmountlist.c +++ b/lib/getmountlist.c @@ -33,10 +33,8 @@ struct mtab_list *getmountlist(int die) 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; } -- cgit v1.2.3