/[rdesktop]/sourceforge.net/trunk/rdesktop/rdesktop.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdesktop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1478 by matthewc, Sat Apr 5 06:15:45 2008 UTC revision 1479 by astrand, Fri Sep 26 11:40:54 2008 UTC
# Line 48  Line 48 
48  #include "ssl.h"  #include "ssl.h"
49    
50  char g_title[64] = "";  char g_title[64] = "";
51  char g_username[64];  char *g_username;
52  char g_hostname[16];  char g_hostname[16];
53  char g_keymapname[PATH_MAX] = "";  char g_keymapname[PATH_MAX] = "";
54  unsigned int g_keylayout = 0x409;       /* Defaults to US keyboard layout */  unsigned int g_keylayout = 0x409;       /* Defaults to US keyboard layout */
# Line 99  RD_BOOL g_redirect = False; Line 99  RD_BOOL g_redirect = False;
99  char g_redirect_server[64];  char g_redirect_server[64];
100  char g_redirect_domain[16];  char g_redirect_domain[16];
101  char g_redirect_password[64];  char g_redirect_password[64];
102  char g_redirect_username[64];  char *g_redirect_username;
103  char g_redirect_cookie[128];  char g_redirect_cookie[128];
104  uint32 g_redirect_flags = 0;  uint32 g_redirect_flags = 0;
105    
# Line 473  main(int argc, char *argv[]) Line 473  main(int argc, char *argv[])
473                                  break;                                  break;
474    
475                          case 'u':                          case 'u':
476                                  STRNCPY(g_username, optarg, sizeof(g_username));                                  g_username = (char *) xmalloc(strlen(optarg) + 1);
477                                    STRNCPY(g_username, optarg, strlen(optarg) + 1);
478                                  username_option = 1;                                  username_option = 1;
479                                  break;                                  break;
480    
# Line 846  main(int argc, char *argv[]) Line 847  main(int argc, char *argv[])
847                          error("could not determine username, use -u\n");                          error("could not determine username, use -u\n");
848                          return 1;                          return 1;
849                  }                  }
850                    /* +1 for trailing \0 */
851                  STRNCPY(g_username, pw->pw_name, sizeof(g_username));                  int pwlen = strlen(pw->pw_name) + 1;
852                    g_username = (char *) xmalloc(pwlen);
853                    STRNCPY(g_username, pw->pw_name, pwlen);
854          }          }
855    
856  #ifdef HAVE_ICONV  #ifdef HAVE_ICONV
# Line 962  main(int argc, char *argv[]) Line 965  main(int argc, char *argv[])
965                          rdesktop_reset_state();                          rdesktop_reset_state();
966    
967                          STRNCPY(domain, g_redirect_domain, sizeof(domain));                          STRNCPY(domain, g_redirect_domain, sizeof(domain));
968                            xfree(g_username);
969                            g_username = (char *) xmalloc(strlen(g_redirect_username) + 1);
970                          STRNCPY(g_username, g_redirect_username, sizeof(g_username));                          STRNCPY(g_username, g_redirect_username, sizeof(g_username));
971                          STRNCPY(password, g_redirect_password, sizeof(password));                          STRNCPY(password, g_redirect_password, sizeof(password));
972                          STRNCPY(server, g_redirect_server, sizeof(server));                          STRNCPY(server, g_redirect_server, sizeof(server));
# Line 1006  main(int argc, char *argv[]) Line 1011  main(int argc, char *argv[])
1011          }          }
1012    
1013  #endif  #endif
1014            if (g_redirect_username)
1015                    xfree(g_redirect_username);
1016    
1017            xfree(g_username);
1018  }  }
1019    
1020  #ifdef EGD_SOCKET  #ifdef EGD_SOCKET

Legend:
Removed from v.1478  
changed lines
  Added in v.1479

  ViewVC Help
Powered by ViewVC 1.1.26