diff options
Diffstat (limited to 'usr.bin/tmux/utf8.c')
-rw-r--r-- | usr.bin/tmux/utf8.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/utf8.c b/usr.bin/tmux/utf8.c index 1e6332e1816..4251ccaab65 100644 --- a/usr.bin/tmux/utf8.c +++ b/usr.bin/tmux/utf8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utf8.c,v 1.11 2014/04/17 15:37:55 nicm Exp $ */ +/* $OpenBSD: utf8.c,v 1.12 2014/10/08 17:35:58 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -419,7 +419,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) @@ -436,7 +436,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); } @@ -452,12 +452,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); } |