Sha256: f24774c6b263b552811d949b02e56348141743b453272cb9099cfc025e278d40
Contents?: true
Size: 368 Bytes
Versions: 9
Compression:
Stored size: 368 Bytes
Contents
// // string_dup.c // // Copyright (c) 2014 Stephen Mathieson // MIT licensed // #ifndef HAVE_STRINGDUP #include <stdlib.h> #include <string.h> #include "string_dup.h" char * string_dup(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_STRINGDUP */
Version data entries
9 entries across 9 versions & 1 rubygems