~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_cache.c

  • Committer: Monty Taylor
  • Date: 2008-09-15 17:24:04 UTC
  • Revision ID: monty@inaugust.com-20080915172404-ygh6hiyu0q7qpa9x
Removed strndup calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "myisamdef.h"
37
37
 
38
 
int _mi_read_cache(IO_CACHE *info, unsigned char *buff, my_off_t pos, uint32_t length,
 
38
int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length,
39
39
                   int flag)
40
40
{
41
 
  uint32_t read_length,in_buff_length;
 
41
  uint read_length,in_buff_length;
42
42
  my_off_t offset;
43
 
  unsigned char *in_buff_pos;
 
43
  uchar *in_buff_pos;
44
44
 
45
45
  if (pos < info->pos_in_file)
46
46
  {
60
60
      (my_off_t) (info->read_end - info->request_pos))
61
61
  {
62
62
    in_buff_pos=info->request_pos+(uint) offset;
63
 
    in_buff_length= cmin(length, (size_t) (info->read_end-in_buff_pos));
 
63
    in_buff_length= min(length, (size_t) (info->read_end-in_buff_pos));
64
64
    memcpy(buff,info->request_pos+(uint) offset,(size_t) in_buff_length);
65
65
    if (!(length-=in_buff_length))
66
66
      return(0);