From dea3c2655dc02c03cf7dc03d058068cf9f0d0970 Mon Sep 17 00:00:00 2001 From: Charles Lindsay Date: Wed, 22 Jan 2014 09:32:50 -0800 Subject: [PATCH] Add comment about ignoring Sscanf error Docker-DCO-1.1-Signed-off-by: Charles Lindsay (github: chazomaticus) --- utils/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/utils.go b/utils/utils.go index ae39bcac36..2a11397212 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -614,6 +614,8 @@ func ParseRelease(release string) (*KernelVersionInfo, error) { flavor string ) + // Ignore error from Sscanf to allow an empty flavor. Instead, just + // make sure we got all the version numbers. parsed, _ = fmt.Sscanf(release, "%d.%d.%d%s", &kernel, &major, &minor, &flavor) if parsed < 3 { return nil, errors.New("Can't parse kernel version " + release)