[clinfo] 15/36: Use snprintf when generating platform symbolic name
Andreas Beckmann
anbe at moszumanska.debian.org
Wed Feb 17 18:32:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
anbe pushed a commit to branch master
in repository clinfo.
commit 284b09d478025e3d024f0940c01207505a9ca331
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date: Wed Dec 9 17:57:38 2015 +0100
Use snprintf when generating platform symbolic name
---
src/clinfo.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/clinfo.c b/src/clinfo.c
index bf171a3..a43aff3 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -447,8 +447,9 @@ printPlatformInfo(cl_uint p)
/* if no CL_PLATFORM_ICD_SUFFIX_KHR, use P### as short/symbolic name */
if (!pdata[p].sname) {
- ALLOC(pdata[p].sname, 32, "platform symbolic name");
- sprintf(pdata[p].sname, "P%u", p);
+#define SNAME_MAX 32
+ ALLOC(pdata[p].sname, SNAME_MAX, "platform symbolic name");
+ snprintf(pdata[p].sname, SNAME_MAX, "P%u", p);
}
len = strlen(pdata[p].sname);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/clinfo.git
More information about the Pkg-opencl-commits
mailing list