"Fossies" - the Fresh Open Source Software Archive

Member "cgiwrap-4.1/stdutil.c" (16 Jun 2008, 1261 Bytes) of package /linux/www/old/cgiwrap-4.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /* 
    2  *  CGIWrap is free software; you can redistribute it and/or modify
    3  *  it under the terms of the GNU General Public License as published by
    4  *  the Free Software Foundation; either version 2 of the License, or
    5  *  (at your option) any later version.
    6  *
    7  *  CGIWrap is distributed in the hope that it will be useful,
    8  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    9  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   10  *  GNU General Public License for more details.
   11  *
   12  *  You should have received a copy of the GNU General Public License
   13  *  along with CGIWrap; if not, write to the Free Software
   14  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   15  *
   16  *  Copyright 2003-2005, Nathan Neulinger <nneul@neulinger.org>
   17  *
   18  */
   19 
   20 /**
   21  **  File: stdutil.c
   22  **  Purpose: Home grown alternatives for routines not in standard library
   23  **/
   24  
   25 #include "cgiwrap.h"    /* Headers for all CGIwrap source files */
   26 RCSID("$Id: stdutil.c 306 2008-06-13 14:02:02Z nneul $");
   27 
   28 /*
   29  * strdup() - copy a string into a newly allocated block of memory
   30  */
   31 #if !defined(HAS_STRDUP)
   32 char *strdup(char *str)
   33 {
   34     char *temp;
   35 
   36     temp = (char *) SafeMalloc ( strlen(str) + 1, "strdup" );
   37     strcpy(temp,str);
   38 
   39     return temp;
   40 }
   41 #endif
   42