From: Benjamin Kaduk Date: Fri, 25 Apr 2014 19:23:16 +0000 (-0400) Subject: rxgen: use unsigned type for max array length X-Git-Tag: upstream/1.8.0_pre1^2~684 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=383602344921ab6dbe72e35bdc085567ccda2b69;p=packages%2Fo%2Fopenafs.git rxgen: use unsigned type for max array length Plain '0' is of type int, i.e., signed, and therefore so is '~0'. The length of an XDR array is unsigned, so this constant should be of an unsigned type. Change-Id: I13f5f94b2f54bc0adcdf2ded1696b797b5205057 Reviewed-on: http://gerrit.openafs.org/11107 Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Perry Ruiter Reviewed-by: Jeffrey Altman Tested-by: BuildBot Reviewed-by: D Brashear --- diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index 9c3d133ed..3deb417cf 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -473,7 +473,7 @@ get_declaration(declaration * dec, defkind dkind) } dec->rel = REL_ARRAY; if (peekscan(TOK_RANGLE, &tok)) { - dec->array_max = "~0"; /* unspecified size, use max */ + dec->array_max = "~0u"; /* unspecified size, use max */ } else { scan_num(&tok); dec->array_max = tok.str;