[balsa/gtk3] Reduce scope of variables



commit cd3c13ee7ab478770a8c9f216178734d025783a6
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jul 22 15:15:24 2012 -0400

    Reduce scope of variables
    
    	* libbalsa/imap/imap_tst.c (get_user), (user_cb): reduce scope
    	of variables.

 ChangeLog                |    5 +++++
 libbalsa/imap/imap_tst.c |    7 ++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c7e624e..e8b784a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-07-22  Peter Bloomfield
 
+	* libbalsa/imap/imap_tst.c (get_user), (user_cb): reduce scope
+	of variables.
+
+2012-07-22  Peter Bloomfield
+
 	* libbalsa/imap/imap_search.c (imap_search_key_new_string),
 	(imap_search_exec_unlocked): reduce scope of variables.
 
diff --git a/libbalsa/imap/imap_tst.c b/libbalsa/imap/imap_tst.c
index e47490b..ccb7127 100644
--- a/libbalsa/imap/imap_tst.c
+++ b/libbalsa/imap/imap_tst.c
@@ -61,13 +61,14 @@ monitor_cb(const char *buffer, int length, int direction, void *arg)
 
 static gchar*
 get_user(const char* method) {
-  char buf[256];
-  size_t len;
 
   if(TestContext.user) {
     printf("Login with method %s as user: %s\n", method, TestContext.user);
     return g_strdup(TestContext.user);
   } else {
+    char buf[256];
+    size_t len;
+
     fprintf(stderr, "Login with method %s as user: ", method);
     fflush(stderr);
     if(!fgets(buf, sizeof(buf), stdin))
@@ -115,9 +116,9 @@ static void
 user_cb(ImapUserEventType ue, void *arg, ...)
 {
     va_list alist;
-    int *ok;
     va_start(alist, arg);
     switch(ue) {
+        int *ok;
     case IME_GET_USER_PASS: {
         gchar *method = va_arg(alist, gchar*);
         gchar **user = va_arg(alist, gchar**);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]