logutil: [bugfix] uninitialized reading offset 78/131978/4
authorRafal Pietruch <r.pietruch@samsung.com>
Wed, 31 May 2017 08:36:50 +0000 (10:36 +0200)
committerRafal Pietruch <r.pietruch@samsung.com>
Thu, 1 Jun 2017 12:26:00 +0000 (14:26 +0200)
commitfeb9d511ae5417522fbe7e16e13bd4557c00cd18
tree282f0290cf5b83aabe65a3492d38e5a3384bd56c
parent06754cba5e8a42f09b2a69ae189569c1a6a11906
logutil: [bugfix] uninitialized reading offset

when creating struct fd_info for PIPE backend
the index field was not initialized causing
unpredictable behavior
thus the new function for the struct creation
was extracted to properly initialize the struct
anytime it is needed

Also:
* issue with possible allocation of 0 bytes was fixed
* strcmp used in case of strncmp where it makes no difference

Change-Id: Id791d3366b363da9a74a5eed6d2942219a3577c1
src/logutil/logutil.c