From cd7231a93817f5fb4f4db9ee6a33f92259b61def Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 30 Sep 2006 17:50:23 +0000 Subject: [PATCH] use snprintf --- src/os/darwin/darwin_sigar.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index f126572e..38882a33 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -2199,11 +2199,15 @@ int sigar_os_sys_info_get(sigar_t *sigar, Gestalt(gestaltSystemVersionMinor, &version_minor); Gestalt(gestaltSystemVersionBugFix, &version_fix); - sprintf(sysinfo->vendor_version, "%ld.%ld", - version_major, version_minor); + snprintf(sysinfo->vendor_version, + sizeof(sysinfo->vendor_version), + "%ld.%ld", + version_major, version_minor); - sprintf(sysinfo->version, "%s.%ld", - sysinfo->vendor_version, version_fix); + snprintf(sysinfo->version, + sizeof(sysinfo->version), + "%s.%ld", + sysinfo->vendor_version, version_fix); if (version_major == 10) { switch (version_minor) {