Commit 2b3cb54d authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(casify_object): Use SAFE_ALLOCA.

parent f61bef8b
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment