get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/127841/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 127841,
    "url": "http://patchwork.dpdk.org/api/patches/127841/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230601150106.18375-2-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230601150106.18375-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230601150106.18375-2-stephen@networkplumber.org",
    "date": "2023-06-01T15:00:42",
    "name": "[01/25] app: use strlcpy in tests",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "81e711f33d8ce505cfd58330e9701a4e5197aa72",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230601150106.18375-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 28302,
            "url": "http://patchwork.dpdk.org/api/series/28302/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28302",
            "date": "2023-06-01T15:00:41",
            "name": "replace snprintf with strlcpy",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/28302/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/127841/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/127841/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 6DCF442C04;\n\tThu,  1 Jun 2023 17:01:25 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BAF7D42D20;\n\tThu,  1 Jun 2023 17:01:15 +0200 (CEST)",
            "from mail-pl1-f172.google.com (mail-pl1-f172.google.com\n [209.85.214.172])\n by mails.dpdk.org (Postfix) with ESMTP id 6DDA442D17\n for <dev@dpdk.org>; Thu,  1 Jun 2023 17:01:14 +0200 (CEST)",
            "by mail-pl1-f172.google.com with SMTP id\n d9443c01a7336-1b00ecabdf2so8737985ad.2\n for <dev@dpdk.org>; Thu, 01 Jun 2023 08:01:14 -0700 (PDT)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n ij9-20020a170902ab4900b001ac40488620sm3661955plb.92.2023.06.01.08.01.10\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 01 Jun 2023 08:01:11 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631673;\n x=1688223673;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=5V4zO97PRtEsq4DvATu6DdzyIxNiLY8Nd1F9AOpOLO4=;\n b=g7toQa3ISlZVCbmJOGdHKTkNZ8/HXbWhn4uLU0yhbU+IrCt8+4h5ezxQPMusJZCUfR\n NupFFGWy50nh0pyhHY1IhgOkvjJ6jji9qNT48Lj4bQj7Zw1iWGf7NeADFssXzoN+/Cd/\n Ko27YylHc0pNVIv28Q1h5CxjmEep+MhHQVchwfxOJhoAGjWl4OY4mI5l0qNoQPQCJSsC\n +rPH9QSTAcgNMN6eMQMJY+mixee9yFl+YN6MvtR0rAq75X+vdA5uZN82Id+iHsr+IFoh\n wCue/bjONC0wMwmbrBlp1wBP6wllj6uCGfa6NoUFS6SysSJva4WoEJk/q3r59igCA7hT\n 5j6Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1685631673; x=1688223673;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=5V4zO97PRtEsq4DvATu6DdzyIxNiLY8Nd1F9AOpOLO4=;\n b=WRLUXq3qG5F627ieIh4336UU56LQ8ECSPP+fv0mH7umG4cCQmHZKSa+RyjqrGRkT8Q\n Vw2lf6mMsSXrCru0RUNzfq7zSqduQz3sncWVFUrDcxpR61IRgBKeB81vDMw89LWMZH6I\n kbgPLaO/5b/AtkP295ZyXwHGCG6Yuf6nyJ68OajmnwdZ/l858vKyQ3Tubf7ezgID1XmW\n gYmRWW2LZvD4O78GGP6shtt/S3zdnL0MuYH5SkzIYl+wVu2PVUpqjL2iGVgdWAbhGCR1\n xsVJYNjtPFyjrkzaiaKhs1WjfHvy2kZrI0nhMxMH/kr98VwQDhAve/lxlbqq09g4aiFL\n 9n2Q==",
        "X-Gm-Message-State": "AC+VfDyPxPvK6P6z1/nm2Orj3ek70SHRfKQOb2EVZpIi/b/t/ejeCGEa\n qx/8FKBqmkq6PT1l76WCqYL1RYlUZ/8UzVbzIdBzTw==",
        "X-Google-Smtp-Source": "\n ACHHUZ6CDxJDanggNdDYs1+07D1z7baVcm78GKTZzedqECKTz8+IX6y54vEXj702FExGdZPZ022RrQ==",
        "X-Received": "by 2002:a17:902:e849:b0:1ad:1c22:1b53 with SMTP id\n t9-20020a170902e84900b001ad1c221b53mr10280024plg.40.1685631673266;\n Thu, 01 Jun 2023 08:01:13 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Nicolas Chautru <nicolas.chautru@intel.com>, Ori Kam <orika@nvidia.com>,\n Aman Singh <aman.deep.singh@intel.com>,\n Yuying Zhang <yuying.zhang@intel.com>, Jerin Jacob <jerinj@marvell.com>,\n Kiran Kumar K <kirankumark@marvell.com>,\n Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "Subject": "[PATCH 01/25] app: use strlcpy in tests",
        "Date": "Thu,  1 Jun 2023 08:00:42 -0700",
        "Message-Id": "<20230601150106.18375-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230601150106.18375-1-stephen@networkplumber.org>",
        "References": "<20230601150106.18375-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Prefer using strlcpy over snprintf().\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n app/test-bbdev/main.c       |  5 ++---\n app/test-pmd/cmdline_flow.c |  6 +++---\n app/test/process.h          |  2 +-\n app/test/test_graph_perf.c  | 29 ++++++++++++++++-------------\n 4 files changed, 22 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/app/test-bbdev/main.c b/app/test-bbdev/main.c\nindex ec830eb32bc8..b1f2d79f4b07 100644\n--- a/app/test-bbdev/main.c\n+++ b/app/test-bbdev/main.c\n@@ -251,9 +251,8 @@ parse_args(int argc, char **argv, struct test_params *tp)\n \t\t\tTEST_ASSERT(strlen(optarg) > 0,\n \t\t\t\t\t\"Config file name is null\");\n \n-\t\t\tsnprintf(tp->test_vector_filename,\n-\t\t\t\t\tsizeof(tp->test_vector_filename),\n-\t\t\t\t\t\"%s\", optarg);\n+\t\t\tstrlcpy(tp->test_vector_filename, optarg,\n+\t\t\t\tsizeof(tp->test_vector_filename));\n \t\t\tbreak;\n \t\tcase 's':\n \t\t\tTEST_ASSERT(strlen(optarg) > 0,\ndiff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex 58939ec321d6..40f67d126b4b 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -10028,7 +10028,7 @@ parse_hex_string(const char *src, uint8_t *dst, uint32_t *size)\n \t\tchar tmp[3], *end = tmp;\n \t\tuint32_t read_lim = left & 1 ? 1 : 2;\n \n-\t\tsnprintf(tmp, read_lim + 1, \"%s\", src);\n+\t\tstrlcpy(tmp, src, read_lim + 1);\n \t\t*dst = strtoul(tmp, &end, 16);\n \t\tif (*end) {\n \t\t\t*dst = 0;\n@@ -11404,7 +11404,7 @@ cmd_flow_get_help(cmdline_parse_token_hdr_t *hdr, char *dst, unsigned int size)\n \tif (!size)\n \t\treturn -1;\n \t/* Set token type and update global help with details. */\n-\tstrlcpy(dst, (token->type ? token->type : \"TOKEN\"), size);\n+\tstrlcpy(dst, token->type ? : \"TOKEN\", size);\n \tif (token->help)\n \t\tcmd_flow.help_str = token->help;\n \telse\n@@ -12220,7 +12220,7 @@ cmd_set_raw_get_help(cmdline_parse_token_hdr_t *hdr, char *dst,\n \tif (!size)\n \t\treturn -1;\n \t/* Set token type and update global help with details. */\n-\tsnprintf(dst, size, \"%s\", (token->type ? token->type : \"TOKEN\"));\n+\tstrlcpy(dst, token->type ? : \"TOKEN\", size);\n \tif (token->help)\n \t\tcmd_set_raw.help_str = token->help;\n \telse\ndiff --git a/app/test/process.h b/app/test/process.h\nindex 1f073b9c5c2a..e2bdecb9c807 100644\n--- a/app/test/process.h\n+++ b/app/test/process.h\n@@ -176,7 +176,7 @@ get_current_prefix(char *prefix, int size)\n \t\treturn NULL;\n \n \t/* get the prefix */\n-\tsnprintf(prefix, size, \"%s\", basename(dirname(buf)));\n+\tstrlcpy(prefix, basename(dirname(buf)), size);\n \n \treturn prefix;\n }\ndiff --git a/app/test/test_graph_perf.c b/app/test/test_graph_perf.c\nindex c5b463f700cd..521d4077600d 100644\n--- a/app/test/test_graph_perf.c\n+++ b/app/test/test_graph_perf.c\n@@ -294,8 +294,9 @@ graph_node_count_edges(uint32_t stage, uint16_t node, uint16_t nodes_per_stage,\n \tfor (i = 0; i < nodes_per_stage && edges < MAX_EDGES_PER_NODE; i++) {\n \t\tif (edge_map[stage + 1][i][node]) {\n \t\t\tename[edges] = malloc(sizeof(char) * RTE_NODE_NAMESIZE);\n-\t\t\tsnprintf(ename[edges], RTE_NODE_NAMESIZE, \"%s\",\n-\t\t\t\t rte_node_id_to_name(node_map[stage + 1][i]));\n+\t\t\tstrlcpy(ename[edges],\n+\t\t\t\trte_node_id_to_name(node_map[stage + 1][i]),\n+\t\t\t\tRTE_NODE_NAMESIZE);\n \t\t\tnode_data->next_nodes[edges] = node_map[stage + 1][i];\n \t\t\tnode_data->next_percentage[edges] =\n \t\t\t\tedge_map[stage + 1][i][node];\n@@ -405,9 +406,9 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,\n \t\t\t\tgraph_data->nb_nodes++;\n \t\t\t\tgoto pattern_name_free;\n \t\t\t}\n-\t\t\tsnprintf(node_patterns[graph_data->nb_nodes],\n-\t\t\t\t RTE_NODE_NAMESIZE, \"%s\",\n-\t\t\t\t rte_node_id_to_name(node_map[i][j]));\n+\t\t\tstrlcpy(node_patterns[graph_data->nb_nodes],\n+\t\t\t\trte_node_id_to_name(node_map[i][j]),\n+\t\t\t\tRTE_NODE_NAMESIZE);\n \t\t\tnode_data =\n \t\t\t\t&graph_data->node_data[graph_data->nb_nodes];\n \t\t\tnode_data->node_id = node_map[i][j];\n@@ -467,8 +468,8 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,\n \t\t\tgraph_data->nb_nodes++;\n \t\t\tgoto pattern_name_free;\n \t\t}\n-\t\tsnprintf(node_patterns[graph_data->nb_nodes], RTE_NODE_NAMESIZE,\n-\t\t\t \"%s\", rte_node_id_to_name(src_nodes[i]));\n+\t\tstrlcpy(node_patterns[graph_data->nb_nodes],\n+\t\t\trte_node_id_to_name(src_nodes[i]), RTE_NODE_NAMESIZE);\n \t\tnode_data = &graph_data->node_data[graph_data->nb_nodes];\n \t\tnode_data->node_id = src_nodes[i];\n \t\tnode_data->is_sink = false;\n@@ -479,8 +480,9 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,\n \t\t\tif (!src_map[i][j])\n \t\t\t\tcontinue;\n \t\t\tename[edges] = malloc(sizeof(char) * RTE_NODE_NAMESIZE);\n-\t\t\tsnprintf(ename[edges], RTE_NODE_NAMESIZE, \"%s\",\n-\t\t\t\t rte_node_id_to_name(node_map[0][j]));\n+\t\t\tstrlcpy(ename[edges],\n+\t\t\t\trte_node_id_to_name(node_map[0][j]),\n+\t\t\t\tRTE_NODE_NAMESIZE);\n \t\t\tnode_data->next_nodes[edges] = node_map[0][j];\n \t\t\tnode_data->next_percentage[edges] = src_map[i][j];\n \t\t\tedges++;\n@@ -524,8 +526,8 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,\n \t\t\tgraph_data->nb_nodes++;\n \t\t\tgoto pattern_name_free;\n \t\t}\n-\t\tsnprintf(node_patterns[graph_data->nb_nodes], RTE_NODE_NAMESIZE,\n-\t\t\t \"%s\", rte_node_id_to_name(snk_nodes[i]));\n+\t\tstrlcpy(node_patterns[graph_data->nb_nodes],\n+\t\t\trte_node_id_to_name(snk_nodes[i]), RTE_NODE_NAMESIZE);\n \t\tnode_data = &graph_data->node_data[graph_data->nb_nodes];\n \t\tnode_data->node_id = snk_nodes[i];\n \t\tnode_data->is_sink = true;\n@@ -543,8 +545,9 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,\n \t\t\tif (!snk_map[i][j])\n \t\t\t\tcontinue;\n \t\t\tename[edges] = malloc(sizeof(char) * RTE_NODE_NAMESIZE);\n-\t\t\tsnprintf(ename[edges], RTE_NODE_NAMESIZE, \"%s\",\n-\t\t\t\t rte_node_id_to_name(snk_nodes[j]));\n+\t\t\tstrlcpy(ename[edges],\n+\t\t\t\trte_node_id_to_name(snk_nodes[j]),\n+\t\t\t\tRTE_NODE_NAMESIZE);\n \t\t\tnode_data->next_nodes[edges] = snk_nodes[j];\n \t\t\tnode_data->next_percentage[edges] = snk_map[i][j];\n \t\t\tedges++;\n",
    "prefixes": [
        "01/25"
    ]
}