30 Oct
2009
30 Oct
'09
3:16 a.m.
André Hentschel wrote:
here is a case where valgrind claims about "Source and destination overlap in strcpy". snprintf(data->efcvt_buffer, 80, "%.*le", prec - 1, number); /* take the decimal "point away */ if( prec != 1) - strcpy( data->efcvt_buffer + 1, data->efcvt_buffer + 2); + { + char *src = data->efcvt_buffer + 2, *dest = data->efcvt_buffer + 1; + while ((*dest++=*src++) != 0); + } You should use memmove instead.
Vitaliy.