From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DNS_FROM_AHBL_RHSBL, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Date: Wed, 22 Apr 2015 21:06:30 +0200 From: Felix Janda To: kbd@lists.altlinux.org Message-ID: <20150422190630.GC3170@euler> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Thu, 23 Apr 2015 13:19:25 +0300 Subject: [kbd] [PATCH 3/5] setvtrgb: simplify loop X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2015 19:06:34 -0000 Archived-At: List-Archive: --- src/setvtrgb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/setvtrgb.c b/src/setvtrgb.c index b398615..94501ef 100644 --- a/src/setvtrgb.c +++ b/src/setvtrgb.c @@ -72,9 +72,7 @@ parse_file(FILE *fd, const char *filename) unsigned int rows, cols, val; for (rows = 0; rows < 3; rows++) { - cols = 0; - - while (cols < 16) { + for (cols = 0; cols < 16; cols++) { if ((c = fscanf(fd, "%u", &val)) != 1) { if (c == EOF) error(EXIT_FAILURE, errno, "fscanf"); @@ -88,7 +86,6 @@ parse_file(FILE *fd, const char *filename) if (cols < 15 && fgetc(fd) != ',') error(EXIT_FAILURE, 0, _("Error: %s: Insufficient number of fields in line %u."), filename, rows + 1); - cols++; } if ((c = fgetc(fd)) == EOF) -- 2.0.5