]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2: use strempty()
authorDan Streetman <ddstreet@ieee.org>
Mon, 21 Aug 2023 21:39:20 +0000 (17:39 -0400)
committerDan Streetman <ddstreet@ieee.org>
Thu, 24 Aug 2023 16:33:26 +0000 (12:33 -0400)
src/shared/tpm2-util.c

index 8ba363fdccdcf56f7f9fe702211765f97b3bbbb2..2b9bdb1da4514b80b45474528503c95a2f93e4f0 100644 (file)
@@ -1771,7 +1771,7 @@ char *tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value) {
                         return NULL;
         }
 
-        return strjoin(index, hash ? ":" : "", hash ?: "", value ? "=" : "", value ?: "");
+        return strjoin(index, hash ? ":" : "", strempty(hash), value ? "=" : "", strempty(value));
 }
 
 /* Parse a string argument into an array of Tpm2PCRValue objects.