From a1d144c71ddc11d3e9d9f29e92cf037da382a541 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 6 Sep 2006 17:01:40 -0500 Subject: [DLM] use snprintf in sysfs show Use snprintf(buf, PAGE_SIZE, ...) instead of sprintf in sysfs show methods. Signed-off-by: David Teigland Signed-off-by: Steven Whitehouse --- fs/dlm/lockspace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/dlm') diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c index ff83f80e43eb..109333c8ecb9 100644 --- a/fs/dlm/lockspace.c +++ b/fs/dlm/lockspace.c @@ -66,7 +66,7 @@ static ssize_t dlm_event_store(struct dlm_ls *ls, const char *buf, size_t len) static ssize_t dlm_id_show(struct dlm_ls *ls, char *buf) { - return sprintf(buf, "%u\n", ls->ls_global_id); + return snprintf(buf, PAGE_SIZE, "%u\n", ls->ls_global_id); } static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len) @@ -78,12 +78,12 @@ static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len) static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf) { uint32_t status = dlm_recover_status(ls); - return sprintf(buf, "%x\n", status); + return snprintf(buf, PAGE_SIZE, "%x\n", status); } static ssize_t dlm_recover_nodeid_show(struct dlm_ls *ls, char *buf) { - return sprintf(buf, "%d\n", ls->ls_recover_nodeid); + return snprintf(buf, PAGE_SIZE, "%d\n", ls->ls_recover_nodeid); } struct dlm_attr { -- cgit v1.2.3-58-ga151