Don't use VLAs in adb.
This makes no measurable difference to the sync time; "adb sync" of
everything on /system for a Nexus 9 still takes 20s.
Change-Id: Ifa2626f7453937e43856b9c4ee06e1f5db0aa273
diff --git a/adb/sysdeps_win32.cpp b/adb/sysdeps_win32.cpp
index fd75320..14d1375 100644
--- a/adb/sysdeps_win32.cpp
+++ b/adb/sysdeps_win32.cpp
@@ -567,12 +567,11 @@
// Lookup the string for an unknown error.
char* errmsg = strerror(-1);
- char unknown_error[(errmsg == nullptr ? 0 : strlen(errmsg)) + 1];
- strcpy(unknown_error, errmsg == nullptr ? "" : errmsg);
+ const std::string unknown_error = (errmsg == nullptr) ? "" : errmsg;
// Lookup the string for this error to see if the C Runtime has it.
errmsg = strerror(err);
- if ((errmsg != nullptr) && strcmp(errmsg, unknown_error)) {
+ if (errmsg != nullptr && unknown_error != errmsg) {
// The CRT returned an error message and it is different than the error
// message for an unknown error, so it is probably valid, so use it.
} else {