log: add \n
[oweals/gnunet.git] / src / regex / regex_test_lib.c
index b871ea8728ae67cf62ec2260bcba6b28ab2a959e..c42dbcef66a4f159767ac5c9489a3d35ea42ae10 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  This file is part of GNUnet
- *  (C) 2012 Christian Grothoff (and other contributing authors)
+ *  Copyright (C) 2012 GNUnet e.V.
  *
  *  GNUnet is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published
  *
  *  You should have received a copy of the GNU General Public License
  *  along with GNUnet; see the file COPYING.  If not, write to the
- *  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- *  Boston, MA 02111-1307, USA.
+ *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
  */
 /**
  * @file src/regex/regex_test_lib.c
  * @brief library to read regexes representing IP networks from a file.
  *        and simplyfinying the into one big regex, in order to run
- *        tests (regex performance, mesh profiler).
+ *        tests (regex performance, cadet profiler).
  * @author Bartlomiej Polot
  */
 
@@ -245,7 +245,7 @@ regex_add (struct RegexCombineCtx *ctx, const char *regex)
     len = strlen (p->s);
     if (prefix_l < len) /* only partial match, split existing state */
     {
-      newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx));
+      newctx = GNUNET_new (struct RegexCombineCtx);
       newctx->head = p->head;
       newctx->tail = p->tail;
       newctx->s = GNUNET_malloc(len - prefix_l + 1);
@@ -262,14 +262,14 @@ regex_add (struct RegexCombineCtx *ctx, const char *regex)
   if (NULL == ctx->head && NULL != ctx->s)
   {
     /* this was the end before, add empty string */
-    newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx));
+    newctx = GNUNET_new (struct RegexCombineCtx);
     newctx->s = GNUNET_strdup ("");
     GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx);
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " no match\n");
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " new state %s\n", regex);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " under %s\n", ctx->s);
-  newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx));
+  newctx = GNUNET_new (struct RegexCombineCtx);
   newctx->s = GNUNET_strdup (regex);
   GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx);
 }
@@ -312,7 +312,7 @@ REGEX_TEST_combine (char * const regexes[])
   const char *current;
   struct RegexCombineCtx *ctx;
 
-  ctx = GNUNET_malloc (sizeof (struct RegexCombineCtx));
+  ctx = GNUNET_new (struct RegexCombineCtx);
   for (i = 0; regexes[i]; i++)
   {
     current = regexes[i];
@@ -346,7 +346,7 @@ REGEX_TEST_read_from_file (const char *filename)
   struct GNUNET_DISK_FileHandle *f;
   unsigned int nr;
   unsigned int offset;
-  OFF_T size;
+  off_t size;
   size_t len;
   char *buffer;
   char *regex;