projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply new glyph-image conventions for `cns11643-2'.
[chise/xemacs-chise.git-]
/
src
/
dynarr.c
diff --git
a/src/dynarr.c
b/src/dynarr.c
index
da51455
..
5dfc79d
100644
(file)
--- a/
src/dynarr.c
+++ b/
src/dynarr.c
@@
-116,7
+116,8
@@
Dynarr_realloc (Dynarr *dy, int new_size)
if (DUMPEDP (dy->base))
{
void *new_base = malloc (new_size);
if (DUMPEDP (dy->base))
{
void *new_base = malloc (new_size);
- memcpy (new_base, dy->base, dy->max > new_size ? new_size : dy->max);
+ int max_bytes = dy->max * dy->elsize;
+ memcpy (new_base, dy->base, max_bytes > new_size ? new_size : max_bytes);
dy->base = new_base;
}
else
dy->base = new_base;
}
else
@@
-157,7
+158,7
@@
Dynarr_resize (void *d, int size)
/* Add a number of contiguous elements to the array starting at START. */
void
/* Add a number of contiguous elements to the array starting at START. */
void
-Dynarr_insert_many (void *d, CONST void *el, int len, int start)
+Dynarr_insert_many (void *d, const void *el, int len, int start)
{
Dynarr *dy = (Dynarr *) d;
{
Dynarr *dy = (Dynarr *) d;