OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [string/] [strdup_r.c] - Blame information for rev 645

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#include <reent.h>
2
#include <stdlib.h>
3
#include <string.h>
4
 
5
char *
6
_DEFUN (_strdup_r, (reent_ptr, str),
7
        struct _reent *reent_ptr  _AND
8
        _CONST char   *str)
9
{
10
  size_t len = strlen (str) + 1;
11
  char *copy = _malloc_r (reent_ptr, len);
12
  if (copy)
13
    {
14
      memcpy (copy, str, len);
15
    }
16
  return copy;
17
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.