/[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 973 by astrand, Thu Aug 4 12:44:10 2005 UTC revision 975 by astrand, Thu Aug 4 12:51:44 2005 UTC
# Line 51  Line 51 
51  char g_title[64] = "";  char g_title[64] = "";
52  char g_username[64];  char g_username[64];
53  char g_hostname[16];  char g_hostname[16];
54  char keymapname[PATH_MAX] = "";  char g_keymapname[PATH_MAX] = "";
55  int g_keylayout = 0x409;        /* Defaults to US keyboard layout */  int g_keylayout = 0x409;        /* Defaults to US keyboard layout */
56  int g_keyboard_type = 0x4;      /* Defaults to US keyboard layout */  int g_keyboard_type = 0x4;      /* Defaults to US keyboard layout */
57  int g_keyboard_subtype = 0x0;   /* Defaults to US keyboard layout */  int g_keyboard_subtype = 0x0;   /* Defaults to US keyboard layout */
# Line 382  main(int argc, char *argv[]) Line 382  main(int argc, char *argv[])
382          locale = setlocale(LC_ALL, "");          locale = setlocale(LC_ALL, "");
383          if (locale)          if (locale)
384          {          {
385                  locale = strdup(locale);                  locale = xstrdup(locale);
                 if (locale == NULL)  
                 {  
                         perror("strdup");  
                         exit(1);  
                 }  
386          }          }
387    
388  #endif  #endif
# Line 469  main(int argc, char *argv[]) Line 464  main(int argc, char *argv[])
464                                  break;                                  break;
465    
466                          case 'k':                          case 'k':
467                                  STRNCPY(keymapname, optarg, sizeof(keymapname));                                  STRNCPY(g_keymapname, optarg, sizeof(g_keymapname));
468                                  break;                                  break;
469    
470                          case 'g':                          case 'g':
# Line 757  main(int argc, char *argv[]) Line 752  main(int argc, char *argv[])
752                  STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));                  STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
753          }          }
754    
755          if (keymapname[0] == 0)          if (g_keymapname[0] == 0)
756          {          {
757                  if (locale && xkeymap_from_locale(locale))                  if (locale && xkeymap_from_locale(locale))
758                  {                  {
759                          fprintf(stderr, "Autoselected keyboard map %s\n", keymapname);                          fprintf(stderr, "Autoselected keyboard map %s\n", g_keymapname);
760                  }                  }
761                  else                  else
762                  {                  {
763                          STRNCPY(keymapname, "en-us", sizeof(keymapname));                          STRNCPY(g_keymapname, "en-us", sizeof(g_keymapname));
764                  }                  }
765          }          }
766          if (locale)          if (locale)
# Line 939  xmalloc(int size) Line 934  xmalloc(int size)
934                  exit(1);                  exit(1);
935          }          }
936          return mem;          return mem;
937    }
938    
939    /* strdup */
940    char *
941    xstrdup(const char *s)
942    {
943            char *mem = strdup(s);
944            if (mem == NULL)
945            {
946                    perror("strdup");
947                    exit(1);
948            }
949            return mem;
950  }  }
951    
952  /* realloc; exit if out of memory */  /* realloc; exit if out of memory */

Legend:
Removed from v.973  
changed lines
  Added in v.975

  ViewVC Help
Powered by ViewVC 1.1.26