cleanup: reduce scope of variables

Various things caught by cppcheck that are non-critical.

Change-Id: I495453c84bc15788b85036a163ee36b0ac601fa1
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/main.cpp b/main.cpp
index e2672e4..d8b1135 100644
--- a/main.cpp
+++ b/main.cpp
@@ -55,7 +55,6 @@
 int main(int argc, char* argv[])
 {
     int rc = 0;
-    int c;
     std::string configPath = "";
 
     while (1)
@@ -68,7 +67,7 @@
         // clang-format on
 
         int option_index = 0;
-        c = getopt_long(argc, argv, "c:", long_options, &option_index);
+        int c = getopt_long(argc, argv, "c:", long_options, &option_index);
 
         if (c == -1)
         {