Sha256: 75945735a9c33912beeb974d045d01f416fddcc240c2d9cc90bc23a18a1a4dc0

Contents?: true

Size: 400 Bytes

Versions: 5

Compression:

Stored size: 400 Bytes

Contents

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

#ifndef _WIN32
#ifndef IS_TRAVISCI
#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
#endif

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mathematical-1.6.7 ext/mathematical/mtex2MML/deps/strdup/strdup.c
mathematical-1.6.6 ext/mathematical/mtex2MML/deps/strdup/strdup.c
mathematical-1.6.5 ext/mathematical/mtex2MML/deps/strdup/strdup.c
mathematical-1.6.4 ext/mathematical/mtex2MML/deps/strdup/strdup.c
mathematical-1.6.0 ext/mathematical/mtex2MML/deps/strdup/strdup.c