BSD 4_4_Lite1 release
[unix-history] / usr / src / usr.bin / find / misc.c
index ea9a333..1db34ce 100644 (file)
@@ -1,5 +1,5 @@
 /*-
 /*-
- * Copyright (c) 1990, 1993
+ * Copyright (c) 1990, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  *     The Regents of the University of California.  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
@@ -35,7 +35,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)misc.c     8.2 (Berkeley) 4/1/94";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -63,7 +63,7 @@ brace_subst(orig, store, path, len)
        register char ch, *p;
 
        plen = strlen(path);
        register char ch, *p;
 
        plen = strlen(path);
-       for (p = *store; ch = *orig; ++orig)
+       for (p = *store; (ch = *orig) != '\0'; ++orig)
                if (ch == '{' && orig[1] == '}') {
                        while ((p - *store) + plen > len)
                                if (!(*store = realloc(*store, len *= 2)))
                if (ch == '{' && orig[1] == '}') {
                        while ((p - *store) + plen > len)
                                if (!(*store = realloc(*store, len *= 2)))
@@ -121,7 +121,7 @@ emalloc(len)
 {
        void *p;
 
 {
        void *p;
 
-       if (p = malloc(len))
-               return (p);
-       err(1, NULL);
+       if ((p = malloc(len)) == NULL)
+               err(1, NULL);
+       return (p);
 }
 }