- sscanf type fix
authorMartin Schanzenbach <mschanzenbach@posteo.de>
Sun, 24 Jan 2016 12:39:50 +0000 (12:39 +0000)
committerMartin Schanzenbach <mschanzenbach@posteo.de>
Sun, 24 Jan 2016 12:39:50 +0000 (12:39 +0000)
src/identity-provider/gnunet-service-identity-provider.c
src/identity-provider/identity_token.c
src/identity-provider/plugin_rest_identity_provider.c

index 05b73db1aa385ad8c8d105ceae7affd87c398041..3328035e6ff299a774bc2e09aff0422487623293 100644 (file)
@@ -35,6 +35,7 @@
 #include "gnunet_signatures.h"
 #include "identity_provider.h"
 #include "identity_token.h"
+#include <inttypes.h>
 
 /**
  * First pass state
@@ -368,11 +369,11 @@ handle_token_update (void *cls,
     if (0 == strcmp (attr->name, "exp"))
     {
       sscanf (attr->val_head->value,
-              "%lu",
+              "%"SCNu64,
               &token_exp.abs_value_us);
     } else if (0 == strcmp (attr->name, "nbf")) {
       sscanf (attr->val_head->value,
-              "%lu",
+              "%"SCNu64,
               &token_nbf.abs_value_us);
     }
   }
index 41731bbf4561c1b97a609f7a03cbda4ed5400bc1..958597630547857549f5ca6ab446e8c4bc4344c5 100644 (file)
@@ -28,6 +28,7 @@
 #include "gnunet_signatures.h"
 #include "identity_token.h"
 #include <jansson.h>
+#include <inttypes.h>
 
 #define JWT_ALG "alg"
 
@@ -628,7 +629,7 @@ ticket_payload_serialize (struct TokenTicketPayload *payload,
                                                           sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
 
   GNUNET_asprintf (result, 
-                   "{\"nonce\": \"%lu\",\"identity\": \"%s\",\"label\": \"%s\"}",
+                   "{\"nonce\": \""SCNu64"\",\"identity\": \"%s\",\"label\": \"%s\"}",
                    payload->nonce, identity_key_str, payload->label);
   GNUNET_free (identity_key_str);
 
@@ -818,7 +819,7 @@ ticket_payload_parse(const char *raw_data,
   nonce_str = json_string_value (nonce_json);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found nonce: %s\n", nonce_str);
   
-  GNUNET_assert (0 != sscanf (nonce_str, "%lu", &nonce));
+  GNUNET_assert (0 != sscanf (nonce_str, "%"SCNu64, &nonce));
 
   *result = ticket_payload_create (nonce,
                                    (const struct GNUNET_CRYPTO_EcdsaPublicKey*)&id_pkey,
index 0110ba024c21654964b96a9eb6f53395720f7d74..3a615168226514690a9faf3dd850d6dc65c5477a 100644 (file)
@@ -33,6 +33,7 @@
 #include "gnunet_rest_lib.h"
 #include "microhttpd.h"
 #include <jansson.h>
+#include <inttypes.h>
 #include "gnunet_signatures.h"
 #include "gnunet_identity_provider_service.h"
 
@@ -551,7 +552,7 @@ issue_token_cont (struct RestConnectionDataHandle *con,
   nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map,
                                                  &key);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request nonce: %s\n", nonce_str);
-  sscanf (nonce_str, "%lu", &nonce);
+  sscanf (nonce_str, "%"SCNu64, &nonce);
 
   //Get expiration for token from URL parameter
   GNUNET_CRYPTO_hash (GNUNET_IDENTITY_TOKEN_EXP_STRING,
@@ -799,7 +800,7 @@ exchange_cont (void *cls,
   }
   nonce_str = GNUNET_CONTAINER_multihashmap_get (handle->conndata_handle->url_param_map,
                                                   &key);
-  GNUNET_assert (1 == sscanf (nonce_str, "%lu", &expected_nonce));
+  GNUNET_assert (1 == sscanf (nonce_str, "%"SCNu64, &expected_nonce));
 
   if (ticket_nonce != expected_nonce)
   {