From patchwork Tue Aug 10 18:45:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29403 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:8e8b:0:0:0:0:0 with SMTP id q133csp709330iod; Tue, 10 Aug 2021 11:45:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwafFFPy1AOyJ+l8wtTC71cp/eaPrN6X2LxsC1YTAxeTfgQudvLmg7/x1CyUV6gNpmQyCWv X-Received: by 2002:a17:907:110e:: with SMTP id qu14mr13191632ejb.346.1628621135237; Tue, 10 Aug 2021 11:45:35 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g4si6692419ejh.515.2021.08.10.11.45.33; Tue, 10 Aug 2021 11:45:35 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=AMc8WaTu; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DF716689D21; Tue, 10 Aug 2021 21:45:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074108.outbound.protection.outlook.com [40.92.74.108]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 10F6068085C for ; Tue, 10 Aug 2021 21:45:23 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dNjZdjgSWBffesYhmPvXQn1bdNfwrJIotTmw6zCZEZmttlbRZa6Lj/bo6HQlCZ8mcxkD4nUDdQe+f0eVpfx7wUTLef48pvcbY7bkrG/lg0WFFB4bskiylImlpNgvR+gQZ+ZTHquFgBsWJw98PfzZCpnGI8FoKGz+wYE//YElKgQWBQbazMT9LsSC9Pv3fVaLXO6xGig/p8/NZDE4WxhCLKJq6PaR6so9jkXz6ZQ/b1n+llh84vjHhQz4SSqq5TE1RNqNAjzsr1CnKyBomNcxLct5K/Viisl16vC1uHBKRZvI5e1sKXa975JI8wLmOyfE0beATuSK3ACFz77BXd3XXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xDkHBaa4U0mdDxrk9uVbrcWg7ZPnrb90wwF4ptelCN8=; b=QU4BeVdANUX+GQWPZniLSTUE9IibDItU0W5AFlqS4nLCGEv9HUDwVrXQpzyUu+i5ZEhLCtwmR2qab6ndKSXreZHU1k4UJIx+uwzbZCgISCtbasDdAnYHeiJMd+idlRcEef7oAqCU6hOkkHQeAqoziAaxUi105byJpUU1ZA9TEa0MIiIiL7Kc87Sp3HkNaNbAC0fU9Di/Jr2barITvrCOJUn4Qzw8umLK8zdkme1cpv0WORk0ibVybf2Km+S+oslTKKamxoDHOozmOb3sUdG9rZ+OI3V6D54afM/uCM6zgItX0mnFMNSiDqKmzjhXK75pI3hZxnqOi+Q2WisvfdnvIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xDkHBaa4U0mdDxrk9uVbrcWg7ZPnrb90wwF4ptelCN8=; b=AMc8WaTuzKnNqv5uOdK3qFemVhR6UZLNlLYMcDTx+keF+xe1fTvXk3psq8FYFuhy6aAq1VXMZPJkqFY7D95SFzz39CC2QhYsuB7zb5acqbu9zYeLfTO6VVahgE5ayuZZfq7/jMeJRefy7/Gx5WaHevLp0SPy4B0/0TF1KpF029gnb7mycsFWfxvE0TjiWUKdcezP3P6ml9tvA0cgbYwQXbayIADOJbec0HSxTnbUX5MJRx/50rpq+cH3SuAGv6nE4KeWZb6E1vx/rmiuisClH3qs0nXSxQW/z8q/K392JaMUoPtg+wR5/Q+27+2kLERKEhMVWjZHAMvGq86yGAq1FA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4824.eurprd03.prod.outlook.com (2603:10a6:20b:84::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Tue, 10 Aug 2021 18:45:21 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ded:bace:bc7:e91d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::ded:bace:bc7:e91d%3]) with mapi id 15.20.4394.023; Tue, 10 Aug 2021 18:45:21 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Aug 2021 20:45:14 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 X-TMN: [ZzpmLqBN4bWt3BWAAckRFAmWb9jSBFT8] X-ClientProxiedBy: AM0PR10CA0087.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::40) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210810184514.644201-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.95.102) by AM0PR10CA0087.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16 via Frontend Transport; Tue, 10 Aug 2021 18:45:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b3325be-42bb-4beb-2b1c-08d95c2f01c0 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNVNZZwRrMzTbfbPbtn9UOclWuhIm2rgt9zExbrAw1yDDHGTH6B79y58RCxt+qMS43ayzm6WrLy1Dl0byjkv7umR8kspg0dk0bMGUQsPrzABnke4RDL1wXzTYKXXGmNegkR6Xm5Dyy4GNM6G6aWmnWsBZFNVVqL+UkXvApaZ8ZPxW99lpl37XY3BLxHpDQQAMAdn7sh/CYSP9xe83AqHECXKJ+BWYGRjui/rfhnRycyJCMiH0wIuwYpKaZpvYLqaoBy9vtcuPDsjIol/PGKTidULJP1xIqHs99xHVwmCfg6b9KoVp+W5CwgwYAjTuATa/iE0QujZwzgoThG2VwwLYyWYjJdIpDzvdyvDJiR+d8B1ygrRpolPyTzY3CjmllqqZQwXDcLFhVfEtaHfYiHtg2t+NY5jrulQklFL2B721wJnUfY66tsAjBHX5eF2jFMhMboh7a7Q+xUeOQnAKnBDJBxevD0Nnr34Md5Jx9F+/h1Fgjpqun3fDiHKsMcIwuXGStoP0KYOlWNjjcp0TPjMqDu3HBL/jwIAS5y+Q7ZE45MlaQ2BG7wUkYC4krxw+kvRL4Yl6YbFySqzKjVUX6VutWj1obx25sULNrUYzEuhUYoCHmK1maQlWn5KlBPCmxwaI6DWjYoNlN2z+wG2p34+iagUZwk1ZrFLTdnCB4JNO3/lL2h5xJIJDpJiU3dTguXXznpVEkSiMJRARFm1G8L8ZsiTDnClp5fF8QA= X-MS-TrafficTypeDiagnostic: AM6PR03MB4824: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V7xAvwm1oT2e6Lgt+rAANqgfQJ9+sZoDwMcYsODKwKTwp2YKEJ96iI5Pi3KcAY4b27lNKT0kY1Awb67/3NtBZCIMwtb84Q3sjb/tQcCefdCKtPF4JWdSE+6MyP3l+nrH/FWzH9WDJ1WPihYvM4LlJDoVJBFq++/N4N7Cv5N9x7lJIXIbNa7cK7C8quqV63H/XuBTT8D/VDkiLtpNtUApCI3oxToWwCP30msg4DrJze4pzxNmusDnpbFNIkjcNNL7nqhmW80Ulu/e7Y9zr00lts4u6s8SvM6MyIc5QraRW9F1W6T/Y+5dFFB9KNQ/duPHh1Se3wyWGRvl6W8VvlY5aQgS4in6KODlNSfxbdgpzfV5lWdoK93GQIfaKMbFVpoJ0hht8Q/GnMITfEr2EUyGtdA/gpOBe3q2yWVWLyIYmX/Q9lhOrtCMZG0hOsrByjLU X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KY6B29+Ugdcf+0XlaPl3g6pfD8p6ml0TdeeQkShPsPkOVkjahkpK7zTcYarf68H2y3O64BTlLjY8fM9sOUDR4w4qmsgcYwFv/zY2NmpaashrjrB/Hqd9wKoKLyVtPoJZy50OdeM0ws13vKqOv3PxNQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b3325be-42bb-4beb-2b1c-08d95c2f01c0 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2021 18:45:21.6924 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4824 Subject: [FFmpeg-devel] [PATCH] fftools/cmdutils: Use av_strstart() instead of strncmp() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: spkqrA9Xbq7R This also avoids hardcoding lengths. Signed-off-by: Andreas Rheinhardt --- Will apply this tomorrow unless there are objections in order not to block Soft Works' patch. fftools/cmdutils.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 64237a4796..6d0bcd6085 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -903,20 +903,18 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) if (!i && !cmd) { flags = 0; /* missing relative prefix, build absolute value */ } - if (!strncmp(token, "repeat", 6)) { + if (av_strstart(token, "repeat", &arg)) { if (cmd == '-') { flags |= AV_LOG_SKIP_REPEATED; } else { flags &= ~AV_LOG_SKIP_REPEATED; } - arg = token + 6; - } else if (!strncmp(token, "level", 5)) { + } else if (av_strstart(token, "level", &arg)) { if (cmd == '-') { flags &= ~AV_LOG_PRINT_LEVEL; } else { flags |= AV_LOG_PRINT_LEVEL; } - arg = token + 5; } else { break; }