This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

An iconv patch


Hi,

cnt may be zero. We have to deal with it.

-- 
H.J. Lu (hjl@gnu.org)
---
Sat Oct 24 17:54:46 1998  H.J. Lu  <hjl@gnu.org>

	* iconv/gconv_db.c (__gconv_find_transform): Change do loop to
	while loop.

Index: iconv/gconv_db.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/iconv/gconv_db.c,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 gconv_db.c
--- gconv_db.c	1998/10/20 14:16:39	1.1.1.11
+++ gconv_db.c	1998/10/23 15:55:23
@@ -548,7 +548,7 @@
       size_t cnt = *nsteps;
       struct gconv_step *steps = *handle;
 
-      do
+      while (cnt > 0)
 	if (steps[--cnt].counter++ == 0)
 	  {
 	    steps[cnt].shlib_handle =
@@ -563,7 +563,6 @@
 		break;
 	      }
 	  }
-      while (cnt > 0);
     }
 #endif
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]