diff lib/config_file.c @ 600:0a1d03fa2261

2004-11-1 Brian Masney <masneyb@gftp.org> * lib/config_file.c (gftp_read_config_file) - fixes for creating the protocol dropdown when SSL support is disabled (from Aurelien Jarno <aurelien@aurel32.net>)
author masneyb
date Mon, 01 Nov 2004 11:00:21 +0000
parents 7f54d0c0edbc
children b60dad25b641
line wrap: on
line diff
--- a/lib/config_file.c	Fri Oct 29 20:16:40 2004 +0000
+++ b/lib/config_file.c	Mon Nov 01 11:00:21 2004 +0000
@@ -534,7 +534,7 @@
   gftp_config_vars * tmpconfigvar;
   char **protocol_list;
   FILE *conffile;
-  int line, i;
+  int line, i, j;
   size_t len;
 
   gftp_global_options_htable = g_hash_table_new (string_hash_function, 
@@ -543,13 +543,14 @@
   gftp_register_config_vars (gftp_global_config_vars);
 
   protocol_list = NULL;
-  for (i=0; gftp_protocols[i].register_options != NULL; i++)
+  for (i=0, j=0; gftp_protocols[i].register_options != NULL; i++)
     {
       if (gftp_protocols[i].shown)
         {
-          protocol_list = g_realloc (protocol_list, sizeof (char *) * (i + 2));
-          protocol_list[i] = gftp_protocols[i].name;
-          protocol_list[i + 1] = NULL;
+          protocol_list = g_realloc (protocol_list, sizeof (char *) * (j + 2));
+          protocol_list[j] = gftp_protocols[i].name;
+          protocol_list[j + 1] = NULL;
+          j++;
         }
 
       if (gftp_protocols[i].register_options != NULL)