Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl2/texinfo/dist/makeinfo Check x > 0 *before*, no...



details:   https://anonhg.NetBSD.org/src/rev/147ba374f196
branches:  trunk
changeset: 934053:147ba374f196
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Jun 05 12:47:28 2020 +0000

description:
Check x > 0 *before*, not after, using (x - 1) as index of array.

diffstat:

 external/gpl2/texinfo/dist/makeinfo/html.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 09ca728aeab6 -r 147ba374f196 external/gpl2/texinfo/dist/makeinfo/html.c
--- a/external/gpl2/texinfo/dist/makeinfo/html.c        Fri Jun 05 11:16:15 2020 +0000
+++ b/external/gpl2/texinfo/dist/makeinfo/html.c        Fri Jun 05 12:47:28 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: html.c,v 1.1.1.1 2016/01/14 00:11:29 christos Exp $    */
+/*     $NetBSD: html.c,v 1.2 2020/06/05 12:47:28 rin Exp $     */
 
 /* html.c -- html-related utilities.
    Id: html.c,v 1.28 2004/12/06 01:13:06 karl Exp 
@@ -447,7 +447,7 @@
     return 0;
 
   /* Find the end of the previous tag.  */
-  while (output_paragraph[check_position-1] != '>' && check_position > 0)
+  while (check_position > 0 && output_paragraph[check_position-1] != '>')
     check_position--;
 
   /* Save stuff between tag's end to output_paragraph's end.  */
@@ -464,7 +464,7 @@
     }
 
   /* Find the start of the previous tag.  */
-  while (output_paragraph[check_position-1] != '<' && check_position > 0)
+  while (check_position > 0 && output_paragraph[check_position-1] != '<')
     check_position--;
 
   /* Check to see if this is the tag.  */



Home | Main Index | Thread Index | Old Index