Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/gen int -> size_t problems, change do { } while (0)...



details:   https://anonhg.NetBSD.org/src/rev/6c2b4b656131
branches:  trunk
changeset: 472597:6c2b4b656131
user:      christos <christos%NetBSD.org@localhost>
date:      Mon May 03 14:33:50 1999 +0000

description:
int -> size_t problems, change do { } while (0) to for (;;)

diffstat:

 lib/libc/gen/getcwd.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r 37225c795ede -r 6c2b4b656131 lib/libc/gen/getcwd.c
--- a/lib/libc/gen/getcwd.c     Mon May 03 13:12:34 1999 +0000
+++ b/lib/libc/gen/getcwd.c     Mon May 03 14:33:50 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getcwd.c,v 1.17 1999/03/26 22:23:57 sommerfe Exp $     */
+/*     $NetBSD: getcwd.c,v 1.18 1999/05/03 14:33:50 christos Exp $     */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)getcwd.c   8.5 (Berkeley) 2/7/95";
 #else
-__RCSID("$NetBSD: getcwd.c,v 1.17 1999/03/26 22:23:57 sommerfe Exp $");
+__RCSID("$NetBSD: getcwd.c,v 1.18 1999/05/03 14:33:50 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -389,7 +389,8 @@
        char *pt;
        size_t size;
 {
-       int ptsize, bufsize, len;
+       size_t ptsize, bufsize;
+       int len;
        
        /*
         * If no buffer specified by the user, allocate one as necessary.
@@ -408,7 +409,7 @@
                        return (NULL);
                bufsize = ptsize;
        }
-       do {
+       for (;;) {
                len = __getcwd(pt, bufsize);
                if ((len < 0) && (size == 0) && (errno == ERANGE)) {
                        if ((pt = realloc(pt, ptsize *= 2)) == NULL)
@@ -416,7 +417,8 @@
                        bufsize = ptsize;
                        continue;
                }
-       } while (0);
+               break;
+       }
        if (len < 0)
                return NULL;
        else



Home | Main Index | Thread Index | Old Index