/[rdesktop]/jpeg/rdesktop/trunk/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 /jpeg/rdesktop/trunk/rdesktop.c

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

revision 315 by jsorg71, Sun Feb 9 01:38:07 2003 UTC revision 325 by astrand, Tue Feb 11 11:31:04 2003 UTC
# Line 21  Line 21 
21  #include <stdarg.h>             /* va_list va_start va_end */  #include <stdarg.h>             /* va_list va_start va_end */
22  #include <unistd.h>             /* read close getuid getgid getpid getppid gethostname */  #include <unistd.h>             /* read close getuid getgid getpid getppid gethostname */
23  #include <fcntl.h>              /* open */  #include <fcntl.h>              /* open */
 #include <errno.h>              /* save licence uses it. */  
24  #include <pwd.h>                /* getpwuid */  #include <pwd.h>                /* getpwuid */
25  #include <termios.h>            /* tcgetattr tcsetattr */  #include <termios.h>            /* tcgetattr tcsetattr */
26  #include <sys/stat.h>           /* stat */  #include <sys/stat.h>           /* stat */
27  #include <sys/time.h>           /* gettimeofday */  #include <sys/time.h>           /* gettimeofday */
28  #include <sys/times.h>          /* times */  #include <sys/times.h>          /* times */
29    #include <errno.h>
30  #include "rdesktop.h"  #include "rdesktop.h"
31    
32  #ifdef EGD_SOCKET  #ifdef EGD_SOCKET
# Line 243  main(int argc, char *argv[]) Line 243  main(int argc, char *argv[])
243    
244                          case 'a':                          case 'a':
245                                  server_bpp = strtol(optarg, NULL, 10);                                  server_bpp = strtol(optarg, NULL, 10);
246                                  if (server_bpp != 8 && server_bpp != 16 && server_bpp != 15 && server_bpp != 24)                                  if (server_bpp != 8 && server_bpp != 16 && server_bpp != 15
247                                        && server_bpp != 24)
248                                  {                                  {
249                                          error("invalid server bpp\n");                                          error("invalid server bpp\n");
250                                          return 1;                                          return 1;
# Line 514  hexdump(unsigned char *p, unsigned int l Line 515  hexdump(unsigned char *p, unsigned int l
515          }          }
516  }  }
517    
518  #ifdef SAVE_LICENCE  
519  int  int
520  load_licence(unsigned char **data)  load_licence(unsigned char **data)
521  {  {
# Line 572  save_licence(unsigned char *data, int le Line 573  save_licence(unsigned char *data, int le
573                  if ((s_ptr->p) + 4 > data + length)                  if ((s_ptr->p) + 4 > data + length)
574                  {                  {
575                          printf("Error in parsing licence key.\n");                          printf("Error in parsing licence key.\n");
576                          printf("Strings %d end value %x > supplied length (%x)\n",                          printf("Strings %d end value %x > supplied length (%x)\n", i,
577                                 i, s_ptr->p, data + length);                                 (unsigned int) s_ptr->p, (unsigned int) data + length);
578                          return;                          return;
579                  }                  }
580          }          }
# Line 581  save_licence(unsigned char *data, int le Line 582  save_licence(unsigned char *data, int le
582          if (s_ptr->p + len > data + length)          if (s_ptr->p + len > data + length)
583          {          {
584                  printf("Error in parsing licence key.\n");                  printf("Error in parsing licence key.\n");
585                  printf("End of licence %x > supplied length (%x)\n", s_ptr->p + len, data + length);                  printf("End of licence %x > supplied length (%x)\n",
586                           (unsigned int) s_ptr->p + len, (unsigned int) data + length);
587                  return;                  return;
588          }          }
589    
# Line 617  save_licence(unsigned char *data, int le Line 619  save_licence(unsigned char *data, int le
619          fnamewrk = xmalloc(strlen(fname) + 12);          fnamewrk = xmalloc(strlen(fname) + 12);
620          for (y = 0;; y++)          for (y = 0;; y++)
621          {          {
622                  sprintf(fnamewrk, "%s.%lu", fname, y);                  sprintf(fnamewrk, "%s.%lu", fname, (long unsigned int) y);
623                  fnwrkfd = open(fnamewrk, O_WRONLY | O_CREAT | O_EXCL, 0600);                  fnwrkfd = open(fnamewrk, O_WRONLY | O_CREAT | O_EXCL, 0600);
624                  if (fnwrkfd == -1)                  if (fnwrkfd == -1)
625                  {                  {
# Line 670  save_licence(unsigned char *data, int le Line 672  save_licence(unsigned char *data, int le
672          }          }
673    
674  }  }
 #endif  

Legend:
Removed from v.315  
changed lines
  Added in v.325

  ViewVC Help
Powered by ViewVC 1.1.26