Fix: `adb pubkey` prints nothing (Windows)
Running `adb pubkey` on the Windows platform the output will be empty
despite having a valid path to the private key
Replaced `WriteFdExactly(fd)` with `fprintf(stdout)`,
is also consistent with other functions in this module
Test: Compile adb, `make host_cross_adb` (Windows)
Test: `adb pubkey path` should output the public key (Linux & Windows)
Based on git history, the Windows output never worked
since the original Change-Id: I0ae9033dbcd119c12cfb2b3977f1f1954ac800c1
Change-Id: I38a011d311aa7c9bef656c30902ee5224f3027b7
Signed-off-by: Nikita Pustovoi <nikita.pustovoi@navico.com>
diff --git a/client/auth.cpp b/client/auth.cpp
index db4c479..10b835e 100644
--- a/client/auth.cpp
+++ b/client/auth.cpp
@@ -331,9 +331,8 @@
if (!pubkey_from_privkey(&pubkey, filename)) {
return 1;
}
- pubkey.push_back('\n');
-
- return WriteFdExactly(STDOUT_FILENO, pubkey.data(), pubkey.size()) ? 0 : 1;
+ fprintf(stdout, "%s\n", pubkey.data());
+ return 0;
}
#if defined(__linux__)