From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01BCCA00C4; Fri, 1 Jul 2022 18:44:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96EA840A7D; Fri, 1 Jul 2022 18:44:21 +0200 (CEST) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 4AB4940A7B for ; Fri, 1 Jul 2022 18:44:20 +0200 (CEST) Received: by mail-pj1-f41.google.com with SMTP id w1-20020a17090a6b8100b001ef26ab992bso3262327pjj.0 for ; Fri, 01 Jul 2022 09:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ff5PkNexkaG55PlnUkeJiRsmoXV1LFkO4mOWThSWgHU=; b=W5D6FaArvQQfu049FS/VREvNDvn+d0MUhHZ62qDj5xiTECMZipOXRY8+gLbehTYN8i IYeu2x42kDI9QZK11bgv9trzMTyG32aJZjmNQbUIOz0Jyrv2lgmiKPVehxvebyeeESKG hGoMdH+oRlIRGrLd5lkJ8EIQh9wm6fSkxlDrOyiN9KnanDqxBXM3gCk4vgSFafB7zgZQ uN7rk8mB6Vq0DhmwZkvxZqh7ftwx6ZRdHHE1Nq0ZdRpx816+cYO01uRE1mEGE2e14RNq QBKiq/IgB7ExfIOS85aUrTZmJ4zBDMYgD2lg2tRec3ETrZM+c0ttfRcm/zDiKXqMl9ow izHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ff5PkNexkaG55PlnUkeJiRsmoXV1LFkO4mOWThSWgHU=; b=EzlW7xLNBbxVduBRlVZK4bCMhCMMpOO2ni/RwJI6otNY2vo1sqUFOlzcfPFElkFk+5 HHZbN/AYqu+gWIHAZVjPJO8eVl4r5sTA9Xmauntop3mEWVE7g6o73Mj+aIdii9Iiq0cX rG8UxY7JRHmy8zrA7I8WiqBx1Ks97LMywxCLVGf2NkxT49rnD1Htywq5+35y1MGheTQB ydTmh28ggTfg2iFP2SymaIZ7+5HIg51+dC/cJGuWwmrA3hMsddC1oyShhiNgJPbrzn94 B4mTKXxPQutCPU+FEreJxWlsH5F33w0VEm06fJth3uKKMYveXSIhri8alLqZl7sXcXhn 7KFg== X-Gm-Message-State: AJIora+jb/sYruboVl/Zs+Aa57ED4Qrw9upvUnosBUe0Aqf10HMO4Ng6 n2s49f4Yg9SjksKUGrWYV1T7EFYoYggPOyah X-Google-Smtp-Source: AGRyM1simfLPK57y2bPxcbY/CB0tZ5kehZNYEJUKoAsTehauhbTIuY70/UDc88KGbVBi179uZJEmrg== X-Received: by 2002:a17:90b:1b4d:b0:1ec:c42a:7eb5 with SMTP id nv13-20020a17090b1b4d00b001ecc42a7eb5mr17482570pjb.122.1656693859524; Fri, 01 Jul 2022 09:44:19 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id m9-20020a63fd49000000b00408c592db61sm15625754pgj.71.2022.07.01.09.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 09:44:19 -0700 (PDT) Date: Fri, 1 Jul 2022 09:44:16 -0700 From: Stephen Hemminger To: longli@linuxonhyperv.com Cc: longli@microsoft.com, Ferruh Yigit , dev@dpdk.org, Ajay Sharma , Stephen Hemminger Subject: Re: [PATCH 01/17] net/mana: add basic driver, build environment and doc Message-ID: <20220701094416.3d364d4c@hermes.local> In-Reply-To: <1656666167-26035-2-git-send-email-longli@linuxonhyperv.com> References: <1656666167-26035-1-git-send-email-longli@linuxonhyperv.com> <1656666167-26035-2-git-send-email-longli@linuxonhyperv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 1 Jul 2022 02:02:31 -0700 longli@linuxonhyperv.com wrote: > + while (fgets(line, sizeof(line), file) == line) { > + size_t len = strlen(line); > + int ret; > + > + /* Truncate long lines. */ > + if (len == (sizeof(line) - 1)) > + while (line[(len - 1)] != '\n') { > + ret = fgetc(file); > + if (ret == EOF) > + break; > + line[(len - 1)] = ret; An alternative, would be to use getline() which handles arbitrary length input.