summaryrefslogtreecommitdiff
path: root/pith/osdep/pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'pith/osdep/pipe.c')
-rw-r--r--pith/osdep/pipe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pith/osdep/pipe.c b/pith/osdep/pipe.c
index 47a00bd..1e47e83 100644
--- a/pith/osdep/pipe.c
+++ b/pith/osdep/pipe.c
@@ -481,10 +481,11 @@ open_system_pipe(char *command, char **outfile, char **errfile, int mode,
char *
pipe_error_msg(char *cmd, char *op, char *res)
{
- static char ebuf[512];
+ static char ebuf[512 + 16 + 1];
- snprintf(ebuf, 256, "Pipe can't %.256s \"%.32sb\": %.223s",
+ snprintf(ebuf, sizeof(ebuf), "Pipe can't %.256s \"%.32sb\": %.223s",
op ? op : "?", cmd ? cmd : "?", res ? res : "?");
+ ebuf[sizeof(ebuf) - 1] = '\0';
return(ebuf);
}