Changeset 1265 for cacamoo


Ignore:
Timestamp:
Oct 30, 2006, 7:32:05 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Fix a bug in replace().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cacamoo/trunk/src/main.c

    r1253 r1265  
    459459            if(oldlen < newlen)
    460460                s2 = realloc(s2, i2 + tocopy + 1);
    461             memmove(s2 + i2, s1 + i1, tocopy + 1);
     461            memcpy(s2 + i2, s1 + i1, tocopy + 1);
    462462            if(oldlen < newlen)
    463463                free(s1);
     
    469469            s2 = realloc(s2, i2 + tocopy + newlen);
    470470        memmove(s2 + i2, s1 + i1, tocopy);
    471         memcpy(s2 + tocopy, newpiece, newlen);
     471        memcpy(s2 + i2 + tocopy, newpiece, newlen);
    472472        i1 += tocopy + oldlen;
    473473        i2 += tocopy + newlen;
Note: See TracChangeset for help on using the changeset viewer.