login: log PAM errors to syslog, not stderr
[oweals/busybox.git] / runit / runit_lib.c
index 2ed9054fd7ccc25fa582e1c11d7ef8087f62eb52..ec18b5edde54caff64018b8d7cd1fb33f6d51154 100644 (file)
@@ -25,7 +25,7 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-/* Busyboxed by Denis Vlasenko <vda.linux@googlemail.com> */
+/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
 /* Collected into one file from runit's many tiny files */
 /* TODO: review, eliminate unneeded stuff, move good stuff to libbb */
 
@@ -34,6 +34,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include "libbb.h"
 #include "runit_lib.h"
 
+#ifdef UNUSED
 unsigned byte_chr(char *s,unsigned n,int c)
 {
        char ch;
@@ -50,7 +51,6 @@ unsigned byte_chr(char *s,unsigned n,int c)
        return t - s;
 }
 
-#ifdef UNUSED
 static /* as it isn't used anywhere else */
 void tai_pack(char *s, const struct tai *t)
 {
@@ -233,19 +233,23 @@ unsigned pmatch(const char *p, const char *s, unsigned len)
                if (!c) return !len;
                switch (c) {
                case '*':
-                       if (!(c = *p)) return 1;
+                       c = *p;
+                       if (!c) return 1;
                        for (;;) {
                                if (!len) return 0;
                                if (*s == c) break;
-                               ++s; --len;
+                               ++s;
+                               --len;
                        }
                        continue;
                case '+':
-                       if ((c = *p++) != *s) return 0;
+                       c = *p++;
+                       if (c != *s) return 0;
                        for (;;) {
                                if (!len) return 1;
                                if (*s != c) break;
-                               ++s; --len;
+                               ++s;
+                               --len;
                        }
                        continue;
                        /*
@@ -260,7 +264,8 @@ unsigned pmatch(const char *p, const char *s, unsigned len)
                default:
                        if (!len) return 0;
                        if (*s != c) return 0;
-                       ++s; --len;
+                       ++s;
+                       --len;
                        continue;
                }
        }