/* $Id: strdup.c,v 1.1.1.1 2001/08/27 11:27:25 rpalsa Exp $ * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * COPYRIGHT (c) 2000 European Southern Observatory * LICENSE: GNU General Public License version 2 or later * * PROJECT: VLT Data Flow System * AUTHOR: Ralf Palsa -- ESO/DMD/DPG * SUBSYSTEM: Instrument pipelines * * PURPOSE: * Provide the strdup extension, if not provided by system libraries. * * DESCRIPTION: * * $Name: fsmosaic-1_0 $ * $Revision: 1.1.1.1 $ * ---------------------------------------------------------------------------- */ #include #include char *strdup(const char *s) { size_t sz = strlen(s) + 1; char *new = (char *)malloc(sz * sizeof(char)); if (new) memcpy(new, s, sz); return new; }