add assertion
authorChristian Grothoff <christian@grothoff.org>
Thu, 4 Jan 2018 21:21:58 +0000 (22:21 +0100)
committerChristian Grothoff <christian@grothoff.org>
Thu, 4 Jan 2018 21:21:58 +0000 (22:21 +0100)
src/fs/fs_dirmetascan.c
src/gns/gnunet-service-gns_resolver.c
src/util/network.c

index 8a3e37b4911897bd13e0df7c0dc2b798e6217bed..e904b90925f22f9e9445fcabdebf5d6180c51e97 100644 (file)
@@ -211,9 +211,9 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent,
     chld->short_filename[slen-1] = '\0';
   chld->is_directory = is_directory;
   if (NULL != parent)
-      GNUNET_CONTAINER_DLL_insert (parent->children_head,
-                                  parent->children_tail,
-                                  chld);
+    GNUNET_CONTAINER_DLL_insert (parent->children_head,
+                                parent->children_tail,
+                                chld);
   return chld;
 }
 
@@ -259,7 +259,8 @@ process_helper_msgs (void *cls,
   size_t left;
 
 #if 0
-  fprintf (stderr, "DMS parses %u-byte message of type %u\n",
+  fprintf (stderr,
+          "DMS parses %u-byte message of type %u\n",
           (unsigned int) ntohs (msg->size),
           (unsigned int) ntohs (msg->type));
 #endif
@@ -277,11 +278,18 @@ process_helper_msgs (void *cls,
                           filename, GNUNET_NO,
                           GNUNET_FS_DIRSCANNER_FILE_START);
     if (NULL == ds->toplevel)
+    {
       ds->toplevel = expand_tree (ds->pos,
-                                 filename, GNUNET_NO);
+                                 filename,
+                                 GNUNET_NO);
+    }
     else
+    {
+      GNUNET_assert (NULL != ds->pos);
       (void) expand_tree (ds->pos,
-                         filename, GNUNET_NO);
+                         filename,
+                         GNUNET_NO);
+    }
     return GNUNET_OK;
   case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY:
     if (filename[left-1] != '\0')
@@ -303,7 +311,8 @@ process_helper_msgs (void *cls,
                           filename, GNUNET_YES,
                           GNUNET_FS_DIRSCANNER_FILE_START);
     ds->pos = expand_tree (ds->pos,
-                          filename, GNUNET_YES);
+                          filename,
+                          GNUNET_YES);
     if (NULL == ds->toplevel)
       ds->toplevel = ds->pos;
     return GNUNET_OK;
@@ -360,11 +369,13 @@ process_helper_msgs (void *cls,
        break;
       }
       ds->progress_callback (ds->progress_callback_cls,
-                            filename, GNUNET_YES,
+                            filename,
+                            GNUNET_YES,
                             GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED);
       if (0 < left)
       {
-       ds->pos->meta = GNUNET_CONTAINER_meta_data_deserialize (end, left);
+       ds->pos->meta = GNUNET_CONTAINER_meta_data_deserialize (end,
+                                                               left);
        if (NULL == ds->pos->meta)
        {
          GNUNET_break (0);
index ba71e21fa5382c1add291f8299174bf2d7821942..54d7ff94b021876357fc63f995d264af6817afc0 100644 (file)
@@ -2362,7 +2362,8 @@ GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
                     uint32_t record_type,
                     const char *name,
                     enum GNUNET_GNS_LocalOptions options,
-                    GNS_ResultProcessor proc, void *proc_cls)
+                    GNS_ResultProcessor proc,
+                    void *proc_cls)
 {
   struct GNS_ResolverHandle *rh;
 
index cf5ef3e004ba76df83333c9695368b1975a704e0..d7059a0579c21875097204d1c96aaf499cfa15f2 100644 (file)
@@ -1326,9 +1326,10 @@ GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
 #else
   int fd;
 
-  GNUNET_DISK_internal_file_handle_ (h,
-                                     &fd,
-                                     sizeof (int));
+  GNUNET_assert (GNUNET_OK ==
+                GNUNET_DISK_internal_file_handle_ (h,
+                                                   &fd,
+                                                   sizeof (int)));
   FD_SET (fd,
           &fds->sds);
   fds->nsds = GNUNET_MAX (fd + 1,