eal: fix strnlen return value with icc
authorCunming Liang <cunming.liang@intel.com>
Tue, 17 Feb 2015 02:08:01 +0000 (10:08 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 24 Feb 2015 19:22:08 +0000 (20:22 +0100)
commita9b1c67a2ce87b24f60927c57522feb97ccbcda5
tree8d17987a164fdea2ee3a01796f9fbe5ff2334c33
parent128ee4c26d87b7aebe38eaa4d72b37fb5abad644
eal: fix strnlen return value with icc

The problem is that strnlen() here may return invalid value with 32bit icc.
(actually it returns it’s second parameter,e.g: sysconf(_SC_ARG_MAX)).
It starts to manifest hwen max_len parameter is > 2M and using icc –m32 –O2 (or above).

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_eal/common/eal_common_options.c