]> xenbits.xensource.com Git - xen.git/commit
xenpmd.c: use dynamic allocation
authorManuel Bouyer <bouyer@netbsd.org>
Sat, 30 Jan 2021 18:27:10 +0000 (19:27 +0100)
committerIan Jackson <iwj@xenproject.org>
Mon, 1 Feb 2021 15:10:00 +0000 (15:10 +0000)
commitbbed98e7cedcd5072671c21605330075740382d3
treee2264a876a610e1bd3a0a68cb4d0394fa228fe67
parent9dc687f155a57216b83b17f9cde55dd43e06b0cd
xenpmd.c: use dynamic allocation

On NetBSD, d_name is larger than 256, so file_name[284] may not be large
enough (and gcc emits a format-truncation error).
Use asprintf() instead of snprintf() on a static on-stack buffer.

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
Plus

define GNU_SOURCE for asprintf()

Harmless on NetBSD.

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
tools/xenpmd/xenpmd.c