From owner-svn-src-projects@freebsd.org Mon May 20 20:43:56 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E70F1591FF4 for ; Mon, 20 May 2019 20:43:56 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B61759191A; Mon, 20 May 2019 20:43:55 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id y13so11307183lfh.9; Mon, 20 May 2019 13:43:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0egYNnrgAdlz4CkNW5/NWzmZMeaJ6PECNbzx9NKL87k=; b=X3dMsJei6GQ6TeyK+c0fkzHSOhw+9OreX+42jz2xxMp1uMws2XDsVTp+8npa6YFDvQ Dw83VhrU8bXPqTJZXexO/NuIMZYhK3hSZIyJ3C9RQcZdWE/6RNRe56GKkW523WAwvsp0 MvVA1fGr9xW4EJQYQBu9lfSYtyM9lr9190aNKuA74yRsp+IRSckXWT7oQ6qarpqI5e4Z zajcr8Jabf3lLuoR7nQd18i5d2sGW+VteDKduO7/WOosFwUym8c6ZuFmUaD4Mgd9wqNp fkYEe+C4sWqId6ls3s6BYxe/mptaxvzXk25bFrGaICp28FoF3f5VKLJtVGoQg6cV3S5J 4gJQ== X-Gm-Message-State: APjAAAW8SDJRlP1aBVVrW1IsV9zffSh6vBGFnCXYFP3zVbFAWsUNparK t9oJvfgProI5E4WXuVKqQavN5004lNn+9TF2z3opSA== X-Google-Smtp-Source: APXvYqw4EYAVvH/jRjA2OTzxD/uY/Wtig/WRGFpw1GUqGCVNrXshqfLPHbgzJt/UNki0dsZQpQ1oWbHDuP/Wf7Z08Lw= X-Received: by 2002:a19:1908:: with SMTP id 8mr12032922lfz.171.1558385028213; Mon, 20 May 2019 13:43:48 -0700 (PDT) MIME-Version: 1.0 References: <201905201936.x4KJaaIC023310@repo.freebsd.org> <20190520202210.GT2748@kib.kiev.ua> In-Reply-To: <20190520202210.GT2748@kib.kiev.ua> From: Alan Somers Date: Mon, 20 May 2019 14:43:36 -0600 Message-ID: Subject: Re: svn commit: r348007 - projects/fuse2/lib/libc/gen To: Konstantin Belousov Cc: src-committers , svn-src-projects@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: B61759191A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2019 20:43:56 -0000 On Mon, May 20, 2019 at 2:22 PM Konstantin Belousov wrote: > > On Mon, May 20, 2019 at 07:36:36PM +0000, Alan Somers wrote: > > +static bool > > +are_fusefs(const char *fsname, const char *vfc_name) > > +{ > > + const char fusefs[] = "fusefs"; > > + const char fusefs_dot[] = "fusefs."; > Both arrays should be static. Ok. > > > + > > + return (strncmp(fsname, fusefs_dot, strlen(fusefs_dot)) == 0 && > strlen() is not needed, you can use sizeof() - 1. > > > + strcmp(fusefs, vfc_name) == 0); > > +} True, but I though that strlen would be more readable. Clang is smart enough to realize that strlen's argument is a constant and omit the call to strlen, so that's what I went with. Is there any other reason to prefer sizeof() - 1 ? -Alan