From owner-svn-src-head@freebsd.org Sun Jul 22 18:31:16 2018 Return-Path: Delivered-To: svn-src-head@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 8195E105274E; Sun, 22 Jul 2018 18:31:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 365537F6B1; Sun, 22 Jul 2018 18:31:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 178C111AD1; Sun, 22 Jul 2018 18:31:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6MIVF62002709; Sun, 22 Jul 2018 18:31:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6MIVFgv002708; Sun, 22 Jul 2018 18:31:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201807221831.w6MIVFgv002708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 22 Jul 2018 18:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336615 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 336615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2018 18:31:16 -0000 Author: markj Date: Sun Jul 22 18:31:15 2018 New Revision: 336615 URL: https://svnweb.freebsd.org/changeset/base/336615 Log: Use the right buffer size when calling snprintf(). PR: 229952 Modified: head/sys/dev/ocs_fc/ocs_ioctl.c Modified: head/sys/dev/ocs_fc/ocs_ioctl.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_ioctl.c Sun Jul 22 18:07:08 2018 (r336614) +++ head/sys/dev/ocs_fc/ocs_ioctl.c Sun Jul 22 18:31:15 2018 (r336615) @@ -1080,7 +1080,7 @@ ocs_sysctl_init(ocs_t *ocs) struct sysctl_oid *tree = device_get_sysctl_tree(ocs->dev); struct sysctl_oid *vtree; const char *str = NULL; - char sli_intf[16], name[16]; + char name[16]; uint32_t rev, if_type, family, i; ocs_fcport *fcp = NULL; @@ -1120,7 +1120,7 @@ ocs_sysctl_init(ocs_t *ocs) 0, "Firmware Revision"); memset(ocs->sli_intf, 0, sizeof(ocs->sli_intf)); - snprintf(ocs->sli_intf, sizeof(sli_intf), "%08x", + snprintf(ocs->sli_intf, sizeof(ocs->sli_intf), "%08x", ocs_config_read32(ocs, SLI4_INTF_REG)); SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "sli_intf", CTLFLAG_RD,