DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦de7ef488e⟧ TextFile

    Length: 486 (0x1e6)
    Types: TextFile
    Names: »getcpy.c«

Derivation

└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
    └─⟦3658e588a⟧ »EurOpenD3/mail/mh/mh-6.7.tar.Z« 
        └─⟦c75e36ecb⟧ 
            └─⟦this⟧ »mh-6.7/sbr/getcpy.c« 

TextFile

/* getcpy.c - copy a string in managed memory */

#include "../h/mh.h"
#include <stdio.h>


char   *getcpy (str)
register char  *str;
{
    register char  *cp;

    if (!str) {
	if ((cp = malloc ((unsigned) (1))) == NULL)
	    adios (NULLCP, "unable to allocate string storage");
	(void) strcpy (cp, "");
    } else {
	if ((cp = malloc ((unsigned) (strlen (str) + 1))) == NULL)
	    adios (NULLCP, "unable to allocate string storage");

	(void) strcpy (cp, str);
    }
    return cp;
}