MokManager: stop using StrnCat

StrnCat is not available in gnu-efi-3.0.5 (I did not check if it does
actually exists in 3.0.6). Moreover using strcat on a buffer where we've
just done: "buf[0] = '\0'" is a bit silly, we might as well drop the 0
termination and just use strcpy.

It seems there also is no StrnCpy in gnu-efi-3.0.5, but we are passing in
a pointer to the end of file_name minus 4, so strcpy will consume only
4 bytes anyways and there is no need for the "n".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Hans de Goede 2018-03-13 09:26:25 +01:00 committed by Peter Jones
parent 7faf9e86c3
commit 6aa5a62515

View File

@ -1913,8 +1913,7 @@ static BOOLEAN check_der_suffix(CHAR16 * file_name)
if (!file_name || StrLen(file_name) <= 4)
return FALSE;
suffix[0] = '\0';
StrnCat(suffix, file_name + StrLen(file_name) - 4, 4);
StrCpy(suffix, file_name + StrLen(file_name) - 4);
StrLwr(suffix);
for (i = 0; der_suffix[i] != NULL; i++) {