logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: 3d0bfe28993baf50113802c6c63e59d6451939c8
parent cb63c7b5437116d5f79c83c400f2e79aa324b75d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 20 Sep 2024 03:35:22 +0200

cmd/paste: unify error message formatting

Diffstat:

Mcmd/paste.c8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmd/paste.c b/cmd/paste.c @@ -70,12 +70,12 @@ main(int argc, char *argv[]) case 'd': arg = optarg; len = mbsrtowcs(NULL, &arg, 0, NULL); - if(len == (size_t)-1) err(1, "delimiters"); + if(len == (size_t)-1) err(1, "error: delimiters"); warg = calloc((len + 1), sizeof(*warg)); if(warg == NULL) err(1, NULL); arg = optarg; len = mbsrtowcs(warg, &arg, len + 1, NULL); - if(len == (size_t)-1) err(1, "delimiters"); + if(len == (size_t)-1) err(1, "error: delimiters"); delimcnt = tr(delim = warg); break; case 's': @@ -127,7 +127,7 @@ parallel(char **argv) if(p[0] == '-' && !p[1]) lp->fp = stdin; else if(!(lp->fp = fopen(p, "r"))) - err(1, "%s", p); + err(1, "error: %s", p); lp->next = NULL; lp->cnt = cnt; lp->name = p; @@ -245,7 +245,7 @@ tr(wchar_t *arg) else *arg = ch; - if(!cnt) errx(1, "no delimiters specified"); + if(!cnt) errx(1, "error: no delimiters specified"); return (cnt); }