Trim null bytes from kernel version

This commit is contained in:
Aman Gupta 2019-08-12 13:30:54 -07:00 committed by GitHub
parent 8a5bcfdb53
commit 62a406ec1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ func KernelVersionWithContext(ctx context.Context) (version string, err error) {
if err != nil { if err != nil {
return "", err return "", err
} }
return string(utsname.Release[:]), nil return string(utsname.Release[:bytes.IndexByte(utsname.Release[:], 0)]), nil
} }
func getSlackwareVersion(contents []string) string { func getSlackwareVersion(contents []string) string {