summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-command-prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-command-prompt.c')
-rw-r--r--usr.bin/tmux/cmd-command-prompt.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/usr.bin/tmux/cmd-command-prompt.c b/usr.bin/tmux/cmd-command-prompt.c
index 7db34aafb1f..bad8f00b579 100644
--- a/usr.bin/tmux/cmd-command-prompt.c
+++ b/usr.bin/tmux/cmd-command-prompt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-command-prompt.c,v 1.19 2011/07/08 06:37:57 nicm Exp $ */
+/* $OpenBSD: cmd-command-prompt.c,v 1.20 2012/07/10 11:53:01 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <ctype.h>
+#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -138,7 +139,7 @@ cmd_command_prompt_exec(struct cmd *self, struct cmd_ctx *ctx)
status_prompt_set(c, prompt, input, cmd_command_prompt_callback,
cmd_command_prompt_free, cdata, 0);
- xfree(prompt);
+ free(prompt);
return (0);
}
@@ -157,7 +158,7 @@ cmd_command_prompt_callback(void *data, const char *s)
return (0);
new_template = cmd_template_replace(cdata->template, s, cdata->idx);
- xfree(cdata->template);
+ free(cdata->template);
cdata->template = new_template;
/*
@@ -169,7 +170,7 @@ cmd_command_prompt_callback(void *data, const char *s)
input = strsep(&cdata->next_input, ",");
status_prompt_update(c, prompt, input);
- xfree(prompt);
+ free(prompt);
cdata->idx++;
return (1);
}
@@ -178,7 +179,7 @@ cmd_command_prompt_callback(void *data, const char *s)
if (cause != NULL) {
*cause = toupper((u_char) *cause);
status_message_set(c, "%s", cause);
- xfree(cause);
+ free(cause);
}
return (0);
}
@@ -205,11 +206,8 @@ cmd_command_prompt_free(void *data)
{
struct cmd_command_prompt_cdata *cdata = data;
- if (cdata->inputs != NULL)
- xfree(cdata->inputs);
- if (cdata->prompts != NULL)
- xfree(cdata->prompts);
- if (cdata->template != NULL)
- xfree(cdata->template);
- xfree(cdata);
+ free(cdata->inputs);
+ free(cdata->prompts);
+ free(cdata->template);
+ free(cdata);
}