From 05211cdaff7ac117095c2213722b386c0f172ed0 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 17 Jul 2009 22:42:55 +0000 Subject: fix build warnings in 'io-cache' Signed-off-by: Anand V. Avati BUG: 130 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130 --- xlators/performance/io-cache/src/ioc-inode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xlators/performance/io-cache') diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c index c131a48f..ab1d7b60 100644 --- a/xlators/performance/io-cache/src/ioc-inode.c +++ b/xlators/performance/io-cache/src/ioc-inode.c @@ -48,8 +48,14 @@ str_to_ptr (char *string) char * ptr_to_str (void *ptr) { + int ret = 0; char *str = NULL; - asprintf (&str, "%p", ptr); + ret = asprintf (&str, "%p", ptr); + if (-1 == ret) { + gf_log ("ioc", GF_LOG_ERROR, + "asprintf failed while converting ptr to str"); + return NULL; + } return str; } -- cgit