1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 10:31:37 -08:00

(casify_object): Use SAFE_ALLOCA.

This commit is contained in:
Kim F. Storm 2004-06-21 21:52:03 +00:00
parent f61bef8be5
commit 2b3cb54db4

View file

@ -110,8 +110,12 @@ casify_object (flag, obj)
/* The work is not yet finished because of a multibyte
character just encountered. */
int fromlen, j_byte = i;
char *buf
= (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i);
char *buf;
int bufsize;
USE_SAFE_ALLOCA;
bufsize = (len - i) * MAX_MULTIBYTE_LENGTH + i;
SAFE_ALLOCA (buf, char *, bufsize);
/* Copy data already handled. */
bcopy (SDATA (obj), buf, i);
@ -133,6 +137,7 @@ casify_object (flag, obj)
}
obj = make_multibyte_string (buf, SCHARS (obj),
j_byte);
SAFE_FREE (bufsize);
}
return obj;
}