A small library that's provide helpers for programmers

Dependents:   PYRN

MyLibc.cpp

Committer:
clemounet
Date:
2015-04-14
Revision:
4:eef83534b19e
Parent:
1:ee7a5f05513d

File content as of revision 4:eef83534b19e:


#include "MyLibc.h"

#include "mbed.h"

char *strdup(const char *str) {
    uint32_t len;
    char *copy;

    len = strlen(str) + 1;
    if (!(copy = (char*)malloc(len)))
        return 0;
    strncpy(copy,str,len);
    return copy;
}