]> rtime.felk.cvut.cz Git - ulut.git/blobdiff - ulut/ul_logreg.c
Initialization of the first_changed field of timer queue added to make Valgrind happy.
[ulut.git] / ulut / ul_logreg.c
index 7b23c68314d83b8b1053eb855e21c9db10f0b386..f1a54fccc1a500c966ed745d1d42ba3346543a14 100644 (file)
@@ -23,7 +23,9 @@
 
 #include <ctype.h>
 #include <string.h>
+#ifndef __RTL__
 #include <stdlib.h>
+#endif
 #include <ul_logbase.h>
 #include <ul_logreg.h>
 #include <ul_gsacust.h>
@@ -80,9 +82,12 @@ int ul_log_domain_setlevel(const char *name, int setlevel)
   ul_log_domains_it_t it;
   ul_log_domain_t *domain=NULL;
 
-  if((setlevel<0) || (setlevel>UL_LOGL_MAX))
+  if(setlevel<0)
     return -1;
 
+  if(setlevel>UL_LOGL_MAX)
+    setlevel=UL_LOGL_MAX;
+
   if(!name)
     all_fl=1;
   else
@@ -148,10 +153,10 @@ int ul_log_domain_arg2levels(const char *arg)
         return p-arg;
       p++;
     }
-    l=strtol(p,(char**)&r,0);
-    if(!r||(p==r)||(*p&&(*p!=':')&&(*p!=',')))
+    r=p;
+    l=strtol(r,(char**)&p,0);
+    if(!p||(p==r)||(*p&&(*p!=':')&&(*p!=',')))
       return p-arg;
-    p=r;
     if(ul_log_domain_setlevel(name, l)<0)
       return p-arg;
     if(*p)