aboutsummaryrefslogtreecommitdiff
path: root/format.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 /format.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 'format.c')
-rw-r--r--format.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/format.c b/format.c
index baf23ec1..105212a3 100644
--- a/format.c
+++ b/format.c
@@ -17,6 +17,7 @@
*/
#include <sys/types.h>
+#include <sys/param.h>
#include <ctype.h>
#include <errno.h>
@@ -267,7 +268,7 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
/* Expand the buffer and copy in the value. */
while (*len - *off < valuelen + 1) {
- *buf = xrealloc(*buf, 2, *len);
+ *buf = xreallocarray(*buf, 2, *len);
*len *= 2;
}
memcpy(*buf + *off, value, valuelen);
@@ -298,7 +299,7 @@ format_expand(struct format_tree *ft, const char *fmt)
while (*fmt != '\0') {
if (*fmt != '#') {
while (len - off < 2) {
- buf = xrealloc(buf, 2, len);
+ buf = xreallocarray(buf, 2, len);
len *= 2;
}
buf[off++] = *fmt++;
@@ -326,7 +327,7 @@ format_expand(struct format_tree *ft, const char *fmt)
continue;
case '#':
while (len - off < 2) {
- buf = xrealloc(buf, 2, len);
+ buf = xreallocarray(buf, 2, len);
len *= 2;
}
buf[off++] = '#';
@@ -339,7 +340,7 @@ format_expand(struct format_tree *ft, const char *fmt)
s = format_lower[ch - 'a'];
if (s == NULL) {
while (len - off < 3) {
- buf = xrealloc(buf, 2, len);
+ buf = xreallocarray(buf, 2, len);
len *= 2;
}
buf[off++] = '#';