use snprintf

This commit is contained in:
Doug MacEachern 2006-09-30 17:50:23 +00:00
parent f32e386b19
commit cd7231a938

View File

@ -2199,10 +2199,14 @@ int sigar_os_sys_info_get(sigar_t *sigar,
Gestalt(gestaltSystemVersionMinor, &version_minor);
Gestalt(gestaltSystemVersionBugFix, &version_fix);
sprintf(sysinfo->vendor_version, "%ld.%ld",
snprintf(sysinfo->vendor_version,
sizeof(sysinfo->vendor_version),
"%ld.%ld",
version_major, version_minor);
sprintf(sysinfo->version, "%s.%ld",
snprintf(sysinfo->version,
sizeof(sysinfo->version),
"%s.%ld",
sysinfo->vendor_version, version_fix);
if (version_major == 10) {