Kernel - Fixed improper use of sprintf
authorJohn Hodge <[email protected]>
Mon, 9 Jul 2012 07:31:47 +0000 (15:31 +0800)
committerJohn Hodge <[email protected]>
Mon, 9 Jul 2012 07:32:01 +0000 (15:32 +0800)
KernelLand/Kernel/drv/proc.c

index 4f52f5c..954cab6 100644 (file)
@@ -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);
        }

UCC git Repository :: git.ucc.asn.au