mirror of https://github.com/Chizi123/dnscomp.git

Joel Grunbaum
2022-05-23 b79b3a7406bc87fc57f4280449d809afad18ae04
slist.c
@@ -1,6 +1,6 @@
#include "slist.h"
#include <stdio.h>
#include <stdlib.h>
#include "slist.h"
void split(struct dns_list *head, struct dns_list **a, struct dns_list **b);
struct dns_list *merge(struct dns_list *a, struct dns_list *b);
@@ -50,7 +50,8 @@
    }
    end->next = NULL;
    end->server = server;
    end->time.tv_nsec = 0; end->time.tv_sec = 0;
   end->time.tv_nsec = 0;
   end->time.tv_sec = 0;
    return 0;
}
@@ -99,10 +100,8 @@
struct dns_list *merge(struct dns_list *a, struct dns_list *b)
{
   struct dns_list *out = NULL;
   if (!a)
      return b;
   if (!b)
      return a;
   if (!a) return b;
   if (!b) return a;
   if (comp_times(a->time, b->time) > 0) {
      out = b;
@@ -131,7 +130,8 @@
{
   printf("%-20s | %s\n", "Server", "Time");
   while (head) {
      printf("%-20s | %ld.%09ld\n", head->server, head->time.tv_sec, head->time.tv_nsec);
      printf("%-20s | %ld.%09ld\n", head->server, head->time.tv_sec,
             head->time.tv_nsec);
      head = head->next;
   }
   return 0;