diff options
Diffstat (limited to 'pith/osdep/pipe.c')
-rw-r--r-- | pith/osdep/pipe.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pith/osdep/pipe.c b/pith/osdep/pipe.c index 47a00bdd..c1b46476 100644 --- a/pith/osdep/pipe.c +++ b/pith/osdep/pipe.c @@ -1,11 +1,7 @@ -#if !defined(lint) && !defined(DOS) -static char rcsid[] = "$Id: pipe.c 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $"; -#endif - /* * ======================================================================== + * Copyright 2013-2022 Eduardo Chappa * Copyright 2006-2008 University of Washington - * Copyright 2013-2021 Eduardo Chappa * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -481,10 +477,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); } |