X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemxor.c;h=9502d3983fe697ed2882e52c4df05a1a5c1aa66e;hb=8de32ec2916ffe14843acf4a53a465a5d413577f;hp=ac922a804820926476570e182458e14474ea400a;hpb=8ee4abda8a85170a0748ce56c4571aed5d9257ce;p=gnulib.git diff --git a/lib/memxor.c b/lib/memxor.c index ac922a804..9502d3983 100644 --- a/lib/memxor.c +++ b/lib/memxor.c @@ -1,5 +1,5 @@ /* memxor.c -- perform binary exclusive OR operation of two memory blocks. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,19 +18,18 @@ /* Written by Simon Josefsson. The interface was inspired by memxor in Niels Möller's Nettle. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "memxor.h" void * memxor (void *restrict dest, const void *restrict src, size_t n) { + char const *s = src; char *d = dest; for (; n > 0; n--) - *d++ ^= *src++; + *d++ ^= *s++; return dest; }