--- sourceforge.net/trunk/rdesktop/rdesktop.c 2002/09/01 12:03:33 111 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2002/09/17 09:20:13 171 @@ -1,7 +1,7 @@ /* rdesktop: A Remote Desktop Protocol client. Entrypoint and utility functions - Copyright (C) Matthew Chapman 1999-2001 + Copyright (C) Matthew Chapman 1999-2002 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,8 +34,8 @@ char hostname[16]; char keymapname[16]; int keylayout = 0x409; /* Defaults to US keyboard layout */ -int width; -int height; +int width = 800; +int height = 600; int tcp_port_rdp = TCP_PORT_RDP; BOOL bitmap_compression = True; BOOL sendmotion = True; @@ -50,6 +50,10 @@ static void usage(char *program) { + fprintf(stderr, "rdesktop: A Remote Desktop Protocol client.\n"); + fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2002 Matt Chapman.\n"); + fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n"); + fprintf(stderr, "Usage: %s [options] server\n", program); fprintf(stderr, " -u: user name\n"); fprintf(stderr, " -d: domain\n"); @@ -85,10 +89,6 @@ uint32 flags; int c; - fprintf(stderr, "rdesktop: A Remote Desktop Protocol client.\n"); - fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2001 Matt Chapman.\n"); - fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n"); - flags = RDP_LOGON_NORMAL; domain[0] = password[0] = shell[0] = directory[0] = 0; strcpy(keymapname, "us"); @@ -116,6 +116,9 @@ case 'p': STRNCPY(password, optarg, sizeof(password)); flags |= RDP_LOGON_AUTO; + p = optarg; + while (*p) + *(p++) = 'X'; break; case 'P': @@ -234,31 +237,19 @@ STRNCPY(password, p, sizeof(password)); } - if ((width == 0) || (height == 0)) - { - width = 800; - height = 600; - } - else - { - /* make sure width is a multiple of 4 */ - width = (width + 3) & ~3; - } - - if (!strlen(title)) + if (!strlen(title)) { strcpy(title, "rdesktop - "); strncat(title, server, sizeof(title) - sizeof("rdesktop - ")); } - xkeymap_init1(); if (!ui_init()) return 1; if (!rdp_connect(server, flags, domain, password, shell, directory)) return 1; - fprintf(stderr, "Connection successful.\n"); + DEBUG(("Connection successful.\n")); if (ui_create_window()) { @@ -266,7 +257,7 @@ ui_destroy_window(); } - fprintf(stderr, "Disconnecting...\n"); + DEBUG(("Disconnecting...\n")); rdp_disconnect(); return 0; } @@ -369,26 +360,27 @@ while (offset < len) { - fprintf(stderr, "%04x ", offset); + printf("%04x ", offset); thisline = len - offset; if (thisline > 16) thisline = 16; for (i = 0; i < thisline; i++) - fprintf(stderr, "%02x ", line[i]); + printf("%02x ", line[i]); for (; i < 16; i++) - fprintf(stderr, " "); + printf(" "); for (i = 0; i < thisline; i++) - fprintf(stderr, "%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); + printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.'); - fprintf(stderr, "\n"); + printf("\n"); offset += thisline; line += thisline; } } +#ifdef SAVE_LICENCE int load_licence(unsigned char **data) { @@ -442,3 +434,4 @@ write(fd, data, length); close(fd); } +#endif