diff options
author | Eduardo Chappa <chappa@washington.edu> | 2021-05-08 21:01:02 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2021-05-08 21:01:02 -0600 |
commit | b5eb45a153202d72aeb48de1149e7c74aef979fd (patch) | |
tree | 1fbc156a717e7963cd0c02fd7352bc801949c550 /pith/osdep/pipe.c | |
parent | 2f953255a8c494e3033015eb064c6ecace9ffeda (diff) | |
download | alpine-b5eb45a153202d72aeb48de1149e7c74aef979fd.tar.xz |
* Clear out some gcc warnings, and code improvement. Work in progress.
Diffstat (limited to 'pith/osdep/pipe.c')
-rw-r--r-- | pith/osdep/pipe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pith/osdep/pipe.c b/pith/osdep/pipe.c index 47a00bdd..1e47e83f 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); } |