From owner-svn-src-head@freebsd.org Fri Nov 3 13:08:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 826E0E51F4C; Fri, 3 Nov 2017 13:08:30 +0000 (UTC) (envelope-from cy@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 mx1.freebsd.org (Postfix) with ESMTPS id 5066563AF0; Fri, 3 Nov 2017 13:08:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA3D8TuL051560; Fri, 3 Nov 2017 13:08:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA3D8Tj1051559; Fri, 3 Nov 2017 13:08:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201711031308.vA3D8Tj1051559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 3 Nov 2017 13:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325357 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 325357 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.23 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: Fri, 03 Nov 2017 13:08:30 -0000 Author: cy Date: Fri Nov 3 13:08:29 2017 New Revision: 325357 URL: https://svnweb.freebsd.org/changeset/base/325357 Log: While discussing the new gets_s.c in D12785, ed@ suggested putting {}'s around the if (c == EOF) block to prevent potential 'trailing else' issues from being introduced when refactoring. As my gets_s() code is based on this, it makes sense to fix the same issue here first here and now, then do an svn copy again to capture this history). Suggested by: ed@ in D12785 Modified: head/lib/libc/stdio/gets.c Modified: head/lib/libc/stdio/gets.c ============================================================================== --- head/lib/libc/stdio/gets.c Fri Nov 3 12:52:59 2017 (r325356) +++ head/lib/libc/stdio/gets.c Fri Nov 3 13:08:29 2017 (r325357) @@ -61,13 +61,13 @@ gets(char *buf) warned = 1; } for (s = buf; (c = __sgetc(stdin)) != '\n'; ) { - if (c == EOF) + if (c == EOF) { if (s == buf) { ret = NULL; goto end; } else break; - else + } else *s++ = c; } *s = 0;