src/compat.c
changeset 13 d3554afaa768
child 49 59b09b0aeb96
equal deleted inserted replaced
12:213c3d4abc66 13:d3554afaa768
       
     1 /**
       
     2  *  $Id: config.c 171 2008-08-10 18:20:39Z mbroeker $
       
     3  * $URL: http://localhost/svn/c/mcbot/trunk/src/compat.c $
       
     4  *
       
     5  */
       
     6 #include <stdio.h>
       
     7 #include <stdlib.h>
       
     8 #include <string.h>
       
     9 
       
    10 #include <compat.h>
       
    11 
       
    12 char *compat_strdup (const char *s)
       
    13 {
       
    14     char *buf;
       
    15 
       
    16     buf = malloc (strlen (s) + 1);
       
    17     if (buf != NULL)
       
    18         strcpy (buf, s);
       
    19 
       
    20     return buf;
       
    21 }