]> git.armaanb.net Git - sic.git/blobdiff - util.c
fix include: include sys/select.h for select(2) and FD_(ZERO|SET)
[sic.git] / util.c
diff --git a/util.c b/util.c
index 707fc1388c1b1505595835e11cfba3fdb504bc55..bdba7188b246412d158398b30e6a829c5442940f 100644 (file)
--- a/util.c
+++ b/util.c
@@ -40,27 +40,20 @@ dial(char *host, char *port) {
        return srv;
 }
 
-#define strlcpy _strlcpy
-static void
-strlcpy(char *to, const char *from, int l) {
-       memccpy(to, from, '\0', l);
-       to[l-1] = '\0';
-}
-
 static char *
 eat(char *s, int (*p)(int), int r) {
-       while(s != '\0' && p(*s) == r)
+       while(*s != '\0' && p(*s) == r)
                s++;
        return s;
 }
 
 static char*
 skip(char *s, char c) {
-        while(*s != c && *s != '\0')
-                s++;
-        if (*s != '\0')
-                *s++ = '\0';
-        return s;
+       while(*s != c && *s != '\0')
+               s++;
+       if(*s != '\0')
+               *s++ = '\0';
+       return s;
 }
 
 static void
@@ -68,7 +61,7 @@ trim(char *s) {
        char *e;
 
        e = s + strlen(s) - 1;
-       while (isspace(*e) && e > s)
+       while(isspace(*e) && e > s)
                e--;
        *(e + 1) = '\0';
 }