From: Leo Zhang Date: Wed, 21 Sep 2016 16:25:23 +0000 (+0800) Subject: ceph_fuse: use sizeof get the buf length X-Git-Tag: v11.0.1~139^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11176%2Fhead;p=ceph.git ceph_fuse: use sizeof get the buf length Signed-off-by: LeoZhang --- diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index eeb0c29f2086..f0ff9a6f7e6c 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -161,7 +161,7 @@ int main(int argc, const char **argv, const char *envp[]) { char buf[5050]; string mountpoint = cfuse->get_mount_point(); - snprintf(buf, 5049, "fusermount -u -z %s", mountpoint.c_str()); + snprintf(buf, sizeof(buf), "fusermount -u -z %s", mountpoint.c_str()); int umount_r = system(buf); if (umount_r) { if (umount_r != -1) {