/[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 367 by matthewc, Wed Apr 16 13:04:15 2003 UTC revision 376 by jsorg71, Mon May 19 21:36:33 2003 UTC
# Line 549  unimpl(char *format, ...) Line 549  unimpl(char *format, ...)
549    
550  /* produce a hex dump */  /* produce a hex dump */
551  void  void
552  hexdump(unsigned char *p, unsigned int len)  hexdump(unsigned char *p, int len)
553  {  {
554          unsigned char *line = p;          unsigned char *line = p;
555          unsigned int thisline, offset = 0;          int i, thisline, offset = 0;
         int i;  
556    
557          while (offset < len)          while (offset < len)
558          {          {
# Line 589  load_licence(unsigned char **data) Line 588  load_licence(unsigned char **data)
588          if (home == NULL)          if (home == NULL)
589                  return -1;                  return -1;
590    
591          path = xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));          path = (char*)xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
592          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
593    
594          fd = open(path, O_RDONLY);          fd = open(path, O_RDONLY);
# Line 599  load_licence(unsigned char **data) Line 598  load_licence(unsigned char **data)
598          if (fstat(fd, &st))          if (fstat(fd, &st))
599                  return -1;                  return -1;
600    
601          *data = xmalloc(st.st_size);          *data = (uint8*)xmalloc(st.st_size);
602          length = read(fd, *data, st.st_size);          length = read(fd, *data, st.st_size);
603          close(fd);          close(fd);
604          xfree(path);          xfree(path);
# Line 616  save_licence(unsigned char *data, int le Line 615  save_licence(unsigned char *data, int le
615          if (home == NULL)          if (home == NULL)
616                  return;                  return;
617    
618          path = xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));          path = (char*)xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
619    
620          sprintf(path, "%s/.rdesktop", home);          sprintf(path, "%s/.rdesktop", home);
621          if ((mkdir(path, 0700) == -1) && errno != EEXIST)          if ((mkdir(path, 0700) == -1) && errno != EEXIST)
# Line 628  save_licence(unsigned char *data, int le Line 627  save_licence(unsigned char *data, int le
627          /* write licence to licence.hostname.new, then atomically rename to licence.hostname */          /* write licence to licence.hostname.new, then atomically rename to licence.hostname */
628    
629          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
630          tmppath = xmalloc(strlen(path) + sizeof(".new"));          tmppath = (char*)xmalloc(strlen(path) + sizeof(".new"));
631          strcpy(tmppath, path);          strcpy(tmppath, path);
632          strcat(tmppath, ".new");          strcat(tmppath, ".new");
633    

Legend:
Removed from v.367  
changed lines
  Added in v.376

  ViewVC Help
Powered by ViewVC 1.1.26