Changeset - bb6a0686610a
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-08-02 22:18:56
ohnobinki@ohnopublishing.net
minor spacing issue
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/common/options.c
Show inline comments
 
@@ -98,24 +98,26 @@ int options_init(int argc, char *argv[],
 
  i = strlen(configfileprefix) + strlen(myname) + strlen(".conf") + 1;
 
  configfile = malloc(i);
 
  if(!configfile)
 
    {
 
      perror("malloc");
 
      return 1;
 
    }
 
  strncpy(configfile, configfileprefix, strlen(configfileprefix) + 1);
 
  strcat(configfile, myname);
 
  strcat(configfile, ".conf");
 
  fprintf(stderr, "using configuration file: %s\n", configfile);
 

	
 

	
 
  /* initialize structs */
 
  *allopts = malloc(sizeof(struct options_common));
 
  if(!*allopts)
 
    {
 
      perror("malloc");
 
      free(configfile);
 
      return 1;
 
    }
 
  memset(*allopts, '\0', sizeof(struct options_common));
 

	
 
  (*allopts)->data = malloc(sizeof(struct options_common_data));
 
  if(!(*allopts)->data)
 
    {
 
@@ -130,24 +132,25 @@ int options_init(int argc, char *argv[],
 
  if(!(*allopts)->data)
 
    {
 
      perror("malloc");
 
      free(configfile);
 
      free((*allopts)->data);
 
      free(*allopts);
 
      return 1;
 
    }
 
  memset((*allopts)->remoteio, '\0', sizeof(struct remoteio_opts));
 
  (*allopts)->remoteio->ssh_command = strdup("ssh");
 
  /** @TODO: check for NULL return above */
 

	
 

	
 
  cfg_opt_t common_opts[] =
 
    {
 
      CFG_SIMPLE_STR("ssh-command", &(*allopts)->remoteio->ssh_command),
 
      CFG_END()
 
    };
 

	
 
  /**
 
    In these arrays, I should replace NULL with a pointer to a string in the struct which should hold the result of confuse processing an option. This is partially because confuse will not free the values it parses.
 
    the server sections in the distrencommon.conf describe different servers that the client may connect to
 
   */
 
  cfg_opt_t server_opts[] =
 
    {
0 comments (0 inline, 0 general)