Add comment about ignoring Sscanf error

Docker-DCO-1.1-Signed-off-by: Charles Lindsay <chaz@chazomatic.us> (github: chazomaticus)
Upstream-commit: dea3c2655dc02c03cf7dc03d058068cf9f0d0970
Component: engine
This commit is contained in:
Charles Lindsay
2014-01-22 09:32:50 -08:00
parent 875dd77195
commit c462b24e66

View File

@ -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)