/[rdesktop]/sourceforge.net/trunk/rdesktop/cache.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/cache.c

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

revision 777 by jsorg71, Sat Oct 2 01:36:20 2004 UTC revision 828 by stargo, Sun Mar 6 21:11:18 2005 UTC
# Line 1  Line 1 
1  /*  /*
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Cache routines     Cache routines
4     Copyright (C) Matthew Chapman 1999-2002     Copyright (C) Matthew Chapman 1999-2005
5    
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 189  cache_get_text(uint8 cache_id) Line 189  cache_get_text(uint8 cache_id)
189  {  {
190          DATABLOB *text;          DATABLOB *text;
191    
192          if (cache_id < NUM_ELEMENTS(g_textcache))          text = &g_textcache[cache_id];
193          {          return text;
                 text = &g_textcache[cache_id];  
                 if (text->data != NULL)  
                         return text;  
         }  
   
         error("get text %d\n", cache_id);  
         return NULL;  
194  }  }
195    
196  /* Store a text item in the cache */  /* Store a text item in the cache */
# Line 206  cache_put_text(uint8 cache_id, void *dat Line 199  cache_put_text(uint8 cache_id, void *dat
199  {  {
200          DATABLOB *text;          DATABLOB *text;
201    
202          if (cache_id < NUM_ELEMENTS(g_textcache))          text = &g_textcache[cache_id];
203          {          if (text->data != NULL)
204                  text = &g_textcache[cache_id];                  xfree(text->data);
205                  if (text->data != NULL)          text->data = xmalloc(length);
206                          xfree(text->data);          text->size = length;
207            memcpy(text->data, data, length);
                 text->data = xmalloc(length);  
                 text->size = length;  
                 memcpy(text->data, data, length);  
         }  
         else  
         {  
                 error("put text %d\n", cache_id);  
         }  
208  }  }
209    
210    

Legend:
Removed from v.777  
changed lines
  Added in v.828

  ViewVC Help
Powered by ViewVC 1.1.26