Fix logprint time_t handling 26/212126/3
authorMateusz Majewski <m.majewski2@samsung.com>
Wed, 14 Aug 2019 11:33:12 +0000 (13:33 +0200)
committerMichal Bloch <m.bloch@partner.samsung.com>
Wed, 14 Aug 2019 11:54:42 +0000 (11:54 +0000)
commit30e8edea44294f5540fa8aa4ccd7feb079d8422d
treef3409240210b8f0acb5eaa7844296e675dc99170
parent7b74b02574fbc5065f6a7de31de49e73916044c3
Fix logprint time_t handling

In JSON formatting, I passed to localtime an int variable cast to
time_t. This is UB, as the size of time_t is not defined (in fact,
time_t doesn't even need to be an integer in C). This commit fixes this
by assigning the data to a temporary time_t variable.

Also, such a system was already present when formatting to other
formats, but it featured an unnecessary cast, which this commit removes.

Change-Id: I75d30cf211b9d05c833a798070cf3c0a445956ef
src/shared/logprint.c