aboutsummaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2014-10-21 12:35:58 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2014-10-21 12:35:58 +0100
commit201036ad80f2e51f7238db2adf05914a4a4f5819 (patch)
tree9ccaf6a087b551846b1c6e71a865cda3aac8c0f1 /utf8.c
parent65257b8e9b55d8d180265d714ba9b3637643c6dc (diff)
parent696b5a628f0f31f4c3566b5c0ab51fbd9f9f9880 (diff)
downloadrtmux-201036ad80f2e51f7238db2adf05914a4a4f5819.tar.gz
rtmux-201036ad80f2e51f7238db2adf05914a4a4f5819.tar.bz2
rtmux-201036ad80f2e51f7238db2adf05914a4a4f5819.zip
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/utf8.c b/utf8.c
index 4b2560c4..58475405 100644
--- a/utf8.c
+++ b/utf8.c
@@ -420,7 +420,7 @@ utf8_fromcstr(const char *src)
n = 0;
while (*src != '\0') {
- dst = xrealloc(dst, n + 1, sizeof *dst);
+ dst = xreallocarray(dst, n + 1, sizeof *dst);
if (utf8_open(&dst[n], *src)) {
more = 1;
while (*++src != '\0' && more)
@@ -437,7 +437,7 @@ utf8_fromcstr(const char *src)
n++;
}
- dst = xrealloc(dst, n + 1, sizeof *dst);
+ dst = xreallocarray(dst, n + 1, sizeof *dst);
dst[n].size = 0;
return (dst);
}
@@ -453,12 +453,12 @@ utf8_tocstr(struct utf8_data *src)
n = 0;
for(; src->size != 0; src++) {
- dst = xrealloc(dst, n + src->size, 1);
+ dst = xreallocarray(dst, n + src->size, 1);
memcpy(dst + n, src->data, src->size);
n += src->size;
}
- dst = xrealloc(dst, n + 1, 1);
+ dst = xreallocarray(dst, n + 1, 1);
dst[n] = '\0';
return (dst);
}