Browse Source

fix constants and sizes demo

Steffen Jaeckel 8 years ago
parent
commit
862a02767d
2 changed files with 4 additions and 4 deletions
  1. 2 2
      demos/constants.c
  2. 2 2
      demos/sizes.c

+ 2 - 2
demos/constants.c

@@ -24,14 +24,14 @@ int main(void) {
     /* given a specific constant name, get and print its value */
     /* given a specific constant name, get and print its value */
     char name[] = "CTR_COUNTER_BIG_ENDIAN";
     char name[] = "CTR_COUNTER_BIG_ENDIAN";
     int  value;
     int  value;
+    char *names_list;
+    unsigned int names_list_len;
 
 
     if (crypt_get_constant(name, &value) != 0)
     if (crypt_get_constant(name, &value) != 0)
       exit(EXIT_FAILURE);
       exit(EXIT_FAILURE);
     printf("\n  %s is %d \n\n", name, value);
     printf("\n  %s is %d \n\n", name, value);
 
 
     /* get and print the length of the names (and values) list */
     /* get and print the length of the names (and values) list */
-    char *names_list;
-    unsigned int names_list_len;
 
 
     if (crypt_list_all_constants(NULL, &names_list_len) != 0)
     if (crypt_list_all_constants(NULL, &names_list_len) != 0)
       exit(EXIT_FAILURE);
       exit(EXIT_FAILURE);

+ 2 - 2
demos/sizes.c

@@ -23,13 +23,13 @@ int main(void) {
     /* given a specific size name, get and print its size */
     /* given a specific size name, get and print its size */
     char name[] = "ecc_key";
     char name[] = "ecc_key";
     unsigned int size;
     unsigned int size;
+    char *sizes_list;
+    unsigned int sizes_list_len;
     if(crypt_get_size(name, &size) != 0)
     if(crypt_get_size(name, &size) != 0)
       exit(EXIT_FAILURE);
       exit(EXIT_FAILURE);
     printf("\n  size of '%s' is %u \n\n", name, size);
     printf("\n  size of '%s' is %u \n\n", name, size);
 
 
     /* get and print the length of the names (and sizes) list */
     /* get and print the length of the names (and sizes) list */
-    char *sizes_list;
-    unsigned int sizes_list_len;
     if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0)
     if(crypt_list_all_sizes(NULL, &sizes_list_len) != 0)
        exit(EXIT_FAILURE);
        exit(EXIT_FAILURE);
     printf("  need to allocate %u bytes \n\n", sizes_list_len);
     printf("  need to allocate %u bytes \n\n", sizes_list_len);