Re: [pacman-dev] [PATCH v2 2/3] add arg_to_string helper

2019-10-12 Thread Allan McRae
On 12/10/19 8:20 pm, Ralph Corderoy wrote: > Hi Andrew, > >> -for(i = 0; i + 1 < argc; i++) { >> -strcpy(p, argv[i]); >> -p += strlen(argv[i]); >> -*p++ = ' '; >> -} > > stpcpy(3)? > This patch is just relocating that code block. A change to stpcpy

Re: [pacman-dev] [PATCH v2 2/3] add arg_to_string helper

2019-10-12 Thread Ralph Corderoy
Hi Andrew, > - for(i = 0; i + 1 < argc; i++) { > - strcpy(p, argv[i]); > - p += strlen(argv[i]); > - *p++ = ' '; > - } stpcpy(3)? -- Cheers, Ralph.

[pacman-dev] [PATCH v2 2/3] add arg_to_string helper

2019-10-11 Thread Andrew Gregory
Converts an argc/argv pair to a string for presentation to the user. Signed-off-by: Andrew Gregory --- src/pacman/pacman.c | 26 +- src/pacman/util.c | 23 +++ src/pacman/util.h | 1 + 3 files changed, 29 insertions(+), 21 deletions(-) diff --git