fixed remediation instructions output
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 13 Nov 2012 06:15:46 +0000 (07:15 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 13 Nov 2012 06:15:46 +0000 (07:15 +0100)
src/libimcv/plugins/imv_os/imv_os_state.c

index 44389f2..8bb944f 100644 (file)
@@ -289,7 +289,7 @@ METHOD(imv_state_t, get_remediation_instructions, bool,
        enumerator = this->bad_packages->create_enumerator(this->bad_packages);
        while (enumerator->enumerate(enumerator, &package))
        {
-               len += strlen(package);
+               len += strlen(package) + 1;
        }
        enumerator->destroy(enumerator);
 
@@ -302,8 +302,10 @@ METHOD(imv_state_t, get_remediation_instructions, bool,
        {
                strcpy(pos, package);
                pos += strlen(package);
+               *pos++ = '\n';
        }
        enumerator->destroy(enumerator);
+       *pos = '\0';
 
        *string = this->instructions;
        *uri = lib->settings->get_str(lib->settings,