log: fix log level regexp matching
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 18 Apr 2017 14:22:24 +0000 (16:22 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 19 Apr 2017 23:31:15 +0000 (01:31 +0200)
commit73454ace6ac6fa45fd2be27675a3c2e2907e45ae
treea451da5f68c7e04198f9de422632f69e9e1f74cb
parentea85e941d2f7f86ee67a411592be2682016ae0c7
log: fix log level regexp matching

Fix misuse of regular expression functions, which was producing a
segfault.

After the patch, it works properly:

  $ ./build/app/test --no-huge --log-level=pmd,3
  RTE>>dump_log_types
  [...]
  id 30: user7, level is debug
  id 31: user8, level is debug
  id 32: pmd.i40e.init, level is critical
  id 33: pmd.i40e.driver, level is critical

Coverity issue: 143472
Fixes: a5279180f510 ("eal: change several log levels matching a regexp")

Reported-by: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_eal/common/eal_common_log.c