comparison src/stdlib/SDL_string.c @ 3953:d3c1161652d5 SDL-1.2

C fallback for SDL_revcpy() was off by one. Thanks to Emmanuel Jeandel for the catch. Fixes Bugzilla #424.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 04 Jun 2007 11:43:47 +0000
parents 16f7767f9580
children a1b03ba2fcd0
comparison
equal deleted inserted replaced
3952:e3c28caea46d 3953:d3c1161652d5
287 #ifndef SDL_revcpy 287 #ifndef SDL_revcpy
288 void *SDL_revcpy(void *dst, const void *src, size_t len) 288 void *SDL_revcpy(void *dst, const void *src, size_t len)
289 { 289 {
290 char *srcp = (char *)src; 290 char *srcp = (char *)src;
291 char *dstp = (char *)dst; 291 char *dstp = (char *)dst;
292 srcp += len; 292 srcp += len-1;
293 dstp += len; 293 dstp += len-1;
294 while ( len-- ) { 294 while ( len-- ) {
295 *dstp-- = *srcp--; 295 *dstp-- = *srcp--;
296 } 296 }
297 return dst; 297 return dst;
298 } 298 }