]> mj.ucw.cz Git - libucw.git/blobdiff - lib/pool.c
Added one more check.
[libucw.git] / lib / pool.c
index 4eea7bf700f8e0ab0981bd22c0f2b3933050f546..d581466ba210c87b8a3cb92dea9778a9f78cf259 100644 (file)
@@ -2,6 +2,9 @@
  *     Sherlock Library -- Memory Pools (One-Time Allocation)
  *
  *     (c) 1997--2001 Martin Mares <mj@ucw.cz>
  *     Sherlock Library -- Memory Pools (One-Time Allocation)
  *
  *     (c) 1997--2001 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 #include "lib/lib.h"
  */
 
 #include "lib/lib.h"
@@ -106,3 +109,12 @@ mp_alloc_zero(struct mempool *p, uns s)
   bzero(x, s);
   return x;
 }
   bzero(x, s);
   return x;
 }
+
+char *
+mp_strdup(struct mempool *p, char *s)
+{
+  uns l = strlen(s) + 1;
+  char *t = mp_alloc_fast_noalign(p, l);
+  memcpy(t, s, l);
+  return t;
+}