64-bit BER integers. Fixes bug #114.
[yaz-moved-to-github.git] / src / cqltransform.c
index 996fd63..3846685 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2009 Index Data
  * See the file LICENSE for details.
  */
 
@@ -28,6 +28,7 @@
 #include <yaz/tokenizer.h>
 #include <yaz/wrbuf.h>
 #include <yaz/z-core.h>
+#include <yaz/matchstr.h>
 #include <yaz/oid_db.h>
 #include <yaz/log.h>
 
@@ -105,8 +106,8 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
             wrbuf_puts(type_str, yaz_tok_parse_string(tp));
             t = yaz_tok_move(tp);
         }
-        elem->attributeType = nmem_intdup(ct->nmem, 0);
-        if (sscanf(wrbuf_cstr(type_str), "%d", elem->attributeType)
+        elem->attributeType = nmem_longintdup(ct->nmem, 0);
+        if (sscanf(wrbuf_cstr(type_str), ODR_INT_PRINTF, elem->attributeType)
             != 1)
         {
             wrbuf_destroy(type_str);
@@ -139,7 +140,7 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
         {
             elem->which = Z_AttributeValue_numeric;
             elem->value.numeric =
-                nmem_intdup(ct->nmem, atoi(value_str));
+                nmem_longintdup(ct->nmem, atoi(value_str));
         }
         else
         {
@@ -950,6 +951,7 @@ void cql_transform_set_error(cql_transform_t ct, int error, const char *addinfo)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab