diff --git a/pkg/fanal/analyzer/language/c/conan/conan.go b/pkg/fanal/analyzer/language/c/conan/conan.go index b031ed0b91bd..891ebac08695 100644 --- a/pkg/fanal/analyzer/language/c/conan/conan.go +++ b/pkg/fanal/analyzer/language/c/conan/conan.go @@ -149,7 +149,7 @@ func detectAttribute(attributeName, line string) string { // e.g. `license = "Apache or MIT"` -> ` "Apache or MIT"` -> `"Apache or MIT"` -> `Apache or MIT` if name, v, ok := strings.Cut(line, "="); ok && strings.TrimSpace(name) == attributeName { attr := strings.TrimSpace(v) - return strings.TrimPrefix(strings.TrimSuffix(attr, "\""), "\"") + return strings.Trim(attr, `"`) } return ""