From: Yu Watanabe Date: Tue, 19 Apr 2022 17:23:11 +0000 (+0900) Subject: efi-api: use string_replace_char() X-Git-Tag: v251-rc2~95^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a86ed67edc91e99e58d93140d9f37609141611b;p=thirdparty%2Fsystemd.git efi-api: use string_replace_char() --- diff --git a/src/shared/efi-api.c b/src/shared/efi-api.c index b2c6af8754d..b9faae025b2 100644 --- a/src/shared/efi-api.c +++ b/src/shared/efi-api.c @@ -546,11 +546,3 @@ bool efi_has_tpm2(void) { } #endif - -char *efi_tilt_backslashes(char *s) { - for (char *p = s; *p; p++) - if (*p == '\\') - *p = '/'; - - return s; -} diff --git a/src/shared/efi-api.h b/src/shared/efi-api.h index 5acc9e83ce9..c36524f4042 100644 --- a/src/shared/efi-api.h +++ b/src/shared/efi-api.h @@ -3,6 +3,7 @@ #include "efivars-fundamental.h" #include "efivars.h" +#include "string-util.h" /* Various calls for interfacing with EFI variables from the official UEFI specs. */ @@ -65,4 +66,6 @@ static inline bool efi_has_tpm2(void) { #endif -char *efi_tilt_backslashes(char *s); +static inline char *efi_tilt_backslashes(char *s) { + return string_replace_char(s, '\\', '/'); +}