comparison src/stdlib/SDL_iconv.c @ 3986:4f73308bbb32 SDL-1.2

Whoops, need to actually copy inbuf
author Sam Lantinga <slouken@libsdl.org>
date Thu, 28 Jun 2007 06:53:09 +0000
parents 2f8efcf14c83
children 00486a9c2893
comparison
equal deleted inserted replaced
3985:2f8efcf14c83 3986:4f73308bbb32
37 size_t retCode; 37 size_t retCode;
38 #ifdef ICONV_REALLY_MODIFIES_INBUF 38 #ifdef ICONV_REALLY_MODIFIES_INBUF
39 if ( inbuf && *inbuf && inbytesleft ) { 39 if ( inbuf && *inbuf && inbytesleft ) {
40 char *tmp = SDL_stack_alloc(char, *inbytesleft); 40 char *tmp = SDL_stack_alloc(char, *inbytesleft);
41 char *ptr = tmp; 41 char *ptr = tmp;
42 SDL_memcpy(tmp, inbuf, *inbytesleft);
42 retCode = iconv(cd, &ptr, inbytesleft, outbuf, outbytesleft); 43 retCode = iconv(cd, &ptr, inbytesleft, outbuf, outbytesleft);
43 inbuf += (ptr - tmp); 44 inbuf += (ptr - tmp);
44 SDL_stack_free(tmp); 45 SDL_stack_free(tmp);
45 } else { 46 } else {
46 retCode = iconv(cd, NULL, inbytesleft, outbuf, outbytesleft); 47 retCode = iconv(cd, NULL, inbytesleft, outbuf, outbytesleft);