OSDN Git Service

ucm: parser: Fix snprintf usage
authorHans de Goede <hdegoede@redhat.com>
Tue, 19 Nov 2019 10:48:22 +0000 (11:48 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 19 Nov 2019 11:45:46 +0000 (12:45 +0100)
commit8c4301e7a8c53d25d057c08420f0391ee2426d48
treec69a294822510f0444e584ddd324be9e37b7a680
parentb3a02322d4514ac9cf5c823253ff27e0541e4088
ucm: parser: Fix snprintf usage

There is no need to manually 0 terminate the buffer with snprintf,
only strncpy has the very unfortunate behavior of not guaranteeing 0
termination.

Likewise there is no need to substract one from the buffer size of
the buffer passed to snprintf.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/parser.c