OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

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

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

Line No. Rev Author Line
1 148 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.