From: John Hodge Date: Mon, 9 Jul 2012 07:31:47 +0000 (+0800) Subject: Kernel - Fixed improper use of sprintf X-Git-Tag: rel0.15~611^2~41^2~25 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=ef7bdb38b14462efa2a0fef943080c3b4f2f2ad5;p=tpg%2Facess2.git Kernel - Fixed improper use of sprintf --- diff --git a/KernelLand/Kernel/drv/proc.c b/KernelLand/Kernel/drv/proc.c index 4f52f5ca..954cab62 100644 --- a/KernelLand/Kernel/drv/proc.c +++ b/KernelLand/Kernel/drv/proc.c @@ -111,7 +111,7 @@ int SysFS_Install(char **Options) { { const char *fmt = "Acess2 "EXPAND_STR(KERNEL_VERSION)" "EXPAND_STR(ARCHDIR)" build %i, hash %s"; - gSysFS_Version_Kernel.Node.Size = sprintf(NULL, fmt, BUILD_NUM, gsGitHash); + gSysFS_Version_Kernel.Node.Size = snprintf(NULL, 0, fmt, BUILD_NUM, gsGitHash); gSysFS_Version_Kernel.Node.ImplPtr = malloc( gSysFS_Version_Kernel.Node.Size + 1 ); sprintf(gSysFS_Version_Kernel.Node.ImplPtr, fmt, BUILD_NUM, gsGitHash); }