examples: Use separate variable for exit code

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
Jakub Jelen
2026-03-16 18:20:46 +01:00
parent 6f671919ad
commit def7a679f8

View File

@@ -322,7 +322,7 @@ list_fingerprint(char *file)
int main(int argc, char *argv[])
{
ssh_key key = NULL;
int rc = 0, fd;
int ret = EXIT_FAILURE, rc, fd;
char overwrite[1024] = "";
char *pubkey_file = NULL;
@@ -500,6 +500,8 @@ int main(int argc, char *argv[])
goto end;
}
ret = EXIT_SUCCESS;
end:
if (key != NULL) {
ssh_key_free(key);
@@ -521,5 +523,5 @@ end:
if (pubkey_file != NULL) {
free(pubkey_file);
}
return rc;
return ret;
}