mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-04-20 18:06:56 -04:00
Make Utf8CStr a first class citizen in C++ codebase
Utf8CStr is in many cases a better string view class than std::string_view, because it provides "view" access to a string buffer that is guaranteed to be null terminated. It also has the additional benefit of being UTF-8 verified and can seemlessly cross FFI boundaries. We would want to start use more Utf8CStr in our existing C++ codebase.
This commit is contained in:
@@ -28,7 +28,7 @@ int main(int argc, char *argv[]) {
|
||||
cmdline_logging();
|
||||
init_argv0(argc, argv);
|
||||
|
||||
string_view argv0 = basename(argv[0]);
|
||||
Utf8CStr argv0 = basename(argv[0]);
|
||||
|
||||
umask(0);
|
||||
|
||||
@@ -63,6 +63,6 @@ int main(int argc, char *argv[]) {
|
||||
return app.fn(argc, argv);
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "%s: applet not found\n", argv0.data());
|
||||
fprintf(stderr, "%s: applet not found\n", argv0.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user