/* 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);
}
obj = make_multibyte_string (buf, SCHARS (obj),
j_byte);
+ SAFE_FREE (bufsize);
}
return obj;
}