Sha256: 7112ea8573ec90823288b5a2ef928323332965266043f82d3a9818a5e130cae2

Contents?: true

Size: 400 Bytes

Versions: 2

Compression:

Stored size: 400 Bytes

Contents

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

#ifndef _WIN32
#ifndef SKIP_STRDUP
#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

2 entries across 2 versions & 1 rubygems

Version Path
mathematical-1.6.2 ext/mathematical/mtex2MML/deps/strdup/strdup.c
mathematical-1.6.1 ext/mathematical/mtex2MML/deps/strdup/strdup.c