From 6444f369b8267b94fbd60c8d38bdccbb8bfed288 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 21 Feb 2010 17:38:46 +0100 Subject: [PATCH] Replace MIN by code as recommended by Marco to avoid compiler warning --- bacula/src/filed/xattr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index b4a4f37475..97e5c5c208 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2008-2009 Free Software Foundation Europe e.V. + Copyright (C) 2008-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -749,7 +749,10 @@ static bxattr_exit_code bsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt) * Print the current name into the buffer as its not null terminated we need to * use the length encoded in the string for copying only the needed bytes. */ - cnt = MIN((int)(sizeof(current_attrname) - 1), xattr_list[index]); + cnt = xattr_list[index]; + if (cnt > ((int)sizeof(current_attrname) - 1)) { + cnt = ((int)sizeof(current_attrname) - 1); + } strncpy(current_attrname, xattr_list + (index + 1), cnt); current_attrname[cnt] = '\0'; -- 2.39.5