poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] pk_cmd_exec: Use pk_str_concat


From: Jose E. Marchesi
Subject: Re: [PATCH] pk_cmd_exec: Use pk_str_concat
Date: Mon, 20 Apr 2020 08:52:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi John.

This is OK for master.
Thanks!

    ---
     src/pk-cmd.c | 5 +----
     1 file changed, 1 insertion(+), 4 deletions(-)
    
    diff --git a/src/pk-cmd.c b/src/pk-cmd.c
    index d4f05fa4..99a97986 100644
    --- a/src/pk-cmd.c
    +++ b/src/pk-cmd.c
    @@ -638,10 +638,7 @@ pk_cmd_exec (const char *str)
           if (strncmp (ecmd, "defun ", 6) != 0
               && strncmp (ecmd, "defun\t", 6) != 0)
             {
    -          size_t len = strlen (cmd);
    -          cmd_alloc = xmalloc (len + 2);
    -          memcpy (cmd_alloc, cmd, len);
    -          memcpy (cmd_alloc + len, ";", 2); /* incl. trailing 0 */
    +          cmd_alloc = pk_str_concat (cmd, ";", NULL);
               ecmd = cmd_alloc;
             }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]