aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-02-08 19:29:39 -0600
committerRob Landley <rob@landley.net>2012-02-08 19:29:39 -0600
commit4cd7d19d653eaacff1da3b13eefac3938e888b3d (patch)
tree72f581e0caca2640fbca49e44f7359ef8d7b623f
parent7f28e68546837b5c636060507e2ab4bb581cd82b (diff)
downloadtoybox-4cd7d19d653eaacff1da3b13eefac3938e888b3d.tar.gz
Use stpcpy() (posix 2008) for slight code shrink.
-rw-r--r--lib/getmountlist.c6
1 files 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;
}