If ‘keyid’ is an empty string, then the numeric error code that gets
appended to this error message may be mistaken for the key ID. Address
this by not mentioning any ID in such cases.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
if (len < 0)
return ENOMEM;
- ret = asprintf(str, "certificate with id %s", keyid);
+ if (len)
+ ret = asprintf(str, "certificate with id %s", keyid);
+ else
+ ret = asprintf(str, "certificate");
free(keyid);
break;
}