Sha256: f9ee596805dcc78ef2d860c940cc68f9571f363b10e1ad898466236da3500f49

Contents?: true

Size: 373 Bytes

Versions: 3

Compression:

Stored size: 373 Bytes

Contents

//
// strdup.c
//
// Copyright (c) 2014 Stephen Mathieson
// MIT licensed
//

#ifndef _WIN32
#ifndef HAVE_STRDUP

#include <stdlib.h>
#include <string.h>
#include "strdup.h"

char *
strdup(const char *str) {
  if (!str) return NULL;
  int len = strlen(str) + 1;
  char *buf = malloc(len);
  if (buf) memcpy(buf, str, len);
  return buf;
}

#endif /* HAVE_STRDUP */
#endif

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mathematical-1.5.12 ext/mathematical/mtex2MML/deps/strdup/strdup.c
mathematical-1.5.0 ext/mathematical/mtex2MML/deps/strdup/strdup.c
mathematical-1.4.2 ext/mathematical/mtex2MML/deps/strdup/strdup.c