]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/xtypes-basic.c
xtypes: added first shot on unit parser
[libucw.git] / ucw / xtypes-basic.c
index 4ee14cfa111a17da40c62eb7cdba7fdcb274cd7b..2792cd19109dd32aca0f785d81d0d4d2ba663908 100644 (file)
@@ -69,8 +69,8 @@ static const char *xt_double_parse(const char *str, void *dest, struct mempool *
   char *endptr = NULL;
   errno = 0;
   double result = strtod(str, &endptr);
-  if(*endptr != 0 || endptr == str) return "Could not parse double.";
-  if(errno == ERANGE) return "Could not parse double.";
+  if(*endptr != 0 || endptr == str) return "Could not parse floating point number.";
+  if(errno == ERANGE) return "Could not parse floating point number.";
 
   *((double *) dest) = result;
 
@@ -118,7 +118,7 @@ static const char *xt_bool_parse(const char *str, void *dest, struct mempool *po
   if(!str) return "Cannot parse bool: string is NULL.";
 
   if(str[1] == 0) {
-    if(str[0] == '1') {
+    if(str[0] == '0') {
       *((bool *)dest) = false;
       return NULL;
     }