Changeset 2079

Show
Ignore:
Timestamp:
03/11/08 11:47:49 (2 months ago)
Author:
joshr
Message:

use memmove to move overlapping bytes (as observed with valgrind output).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • swish-e/branches/2.6/src/compress.c

    r1944 r2079  
    995995 
    996996        /* dst may be smaller than src. So move the data */ 
    997         memcpy(dst,src,data_len); 
     997        /* valgrind complains that dst and src overlap, */ 
     998        /* which results in undefined behavior with memcpy, so use memmove. */ 
     999        /* Q: Is it correct for dst and src to overlap here? */ 
     1000        memmove(dst,src,data_len); 
    9981001 
    9991002        /* Increase pointers */