diff mbox series

[2/2] core/artifacts_version: Don't concat version

Message ID 20200624150234.7476-2-sde@unmatched.eu
State Accepted
Headers show
Series [1/2] core/artifacts_version: Fix infinite loop in is_oldstyle_version() | expand

Commit Message

Stijn Devriendt June 24, 2020, 3:02 p.m. UTC
semver_render() doesn't overwrite, but instead appends to the string.
Reset the string to cope.

Signed-off-by: Stijn Devriendt <sde@unmatched.eu>
---
 core/artifacts_versions.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/core/artifacts_versions.c b/core/artifacts_versions.c
index a5649af..06c978a 100644
--- a/core/artifacts_versions.c
+++ b/core/artifacts_versions.c
@@ -192,6 +192,7 @@  void cleanup_version(char* str)
 		return;
 
 	if (semver_parse(str, &version) == 0) {
+		*str = '\0';
 		semver_render(&version, str);
 	} else {
 		WARN("Unparseable version string. Using 0.0.0 instead!");