From: Kern Sibbald Date: Sun, 21 Feb 2010 16:38:46 +0000 (+0100) Subject: Replace MIN by code as recommended by Marco to avoid compiler warning X-Git-Tag: Release-5.2.1~1694 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0e61537df61618e30e9021165bedd4584facefc8;p=bacula%2Fbacula Replace MIN by code as recommended by Marco to avoid compiler warning --- 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';