Staging
v0.8.1
https://github.com/python/cpython
Revision 007ee17e21eeb3dcbb515efa1436f3f669aad2fc authored by Hirokazu Yamamoto on 03 November 2008, 18:18:08 UTC, committed by Hirokazu Yamamoto on 03 November 2008, 18:18:08 UTC
and then remove it. Written by Guilherme Polo (gpolo). Backport of r67082.
1 parent 6f08e85
Raw File
Tip revision: 007ee17e21eeb3dcbb515efa1436f3f669aad2fc authored by Hirokazu Yamamoto on 03 November 2008, 18:18:08 UTC
Issue #3774: Fixed an error when create a Tkinter menu item without command
Tip revision: 007ee17
memmove.c

/* A perhaps slow but I hope correct implementation of memmove */

extern char *memcpy(char *, char *, int);

char *
memmove(char *dst, char *src, int n)
{
	char *realdst = dst;
	if (n <= 0)
		return dst;
	if (src >= dst+n || dst >= src+n)
		return memcpy(dst, src, n);
	if (src > dst) {
		while (--n >= 0)
			*dst++ = *src++;
	}
	else if (src < dst) {
		src += n;
		dst += n;
		while (--n >= 0)
			*--dst = *--src;
	}
	return realdst;
}
back to top