]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
efi-api: use string_replace_char()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Apr 2022 17:23:11 +0000 (02:23 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Apr 2022 17:23:11 +0000 (02:23 +0900)
src/shared/efi-api.c
src/shared/efi-api.h

index b2c6af8754daa7a1c889c67a58f2d07b1c34dfec..b9faae025b29bccd043db4c3b3860912bca4b4b6 100644 (file)
@@ -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;
-}
index 5acc9e83ce9c48dbea67f80de04b8552f5f3ad65..c36524f4042ead7711c59db6b5d478d9a3da80a9 100644 (file)
@@ -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, '\\', '/');
+}