ReactOS  0.4.13-dev-73-gcfe54aa
memmove.c File Reference
#include <string.h>
Include dependency graph for memmove.c:

Go to the source code of this file.

Functions

void *__cdecl memmove (void *dest, const void *src, size_t count)
 

Function Documentation

◆ memmove()

void* __cdecl memmove ( void dest,
const void src,
size_t  count 
)

Definition at line 4 of file memmove.c.

5 {
6  char *char_dest = (char *)dest;
7  char *char_src = (char *)src;
8 
9  if ((char_dest <= char_src) || (char_dest >= (char_src+count)))
10  {
11  /* non-overlapping buffers */
12  while(count > 0)
13  {
14  *char_dest = *char_src;
15  char_dest++;
16  char_src++;
17  count--;
18  }
19  }
20  else
21  {
22  /* overlaping buffers */
23  char_dest = (char *)dest + count - 1;
24  char_src = (char *)src + count - 1;
25 
26  while(count > 0)
27  {
28  *char_dest = *char_src;
29  char_dest--;
30  char_src--;
31  count--;
32  }
33  }
34 
35  return dest;
36 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
static char * dest
Definition: rtl.c:135

Referenced by memcpy().