diff options
author | Andy Lester <andy@petdance.com> | 2005-11-04 09:13:55 -0600 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-11-07 12:26:29 +0000 |
commit | 8665f9e443dd7c1aaeda99d470ddf0b6fe056f80 (patch) | |
tree | 1942b919ad725753da59c9de63d1901bf6299f94 /x2p/util.c | |
parent | f43a9a3142f71956ec256aa7b03ca89db65cbb0c (diff) | |
download | perl-8665f9e443dd7c1aaeda99d470ddf0b6fe056f80.tar.gz |
Cleaning up x2p directory
Message-ID: <20051104211355.GB12651@petdance.com>
p4raw-id: //depot/perl@26033
Diffstat (limited to 'x2p/util.c')
-rw-r--r-- | x2p/util.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/x2p/util.c b/x2p/util.c index 20444decfc..6994e873f7 100644 --- a/x2p/util.c +++ b/x2p/util.c @@ -1,12 +1,10 @@ -/* $RCSfile: util.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:29 $ +/* util.c * * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, - * 2000, 2001, by Larry Wall and others + * 2000, 2001, 2005 by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. - * - * $Log: util.c,v $ */ #include "EXTERN.h" @@ -17,7 +15,7 @@ #include <stdarg.h> #define FLUSH -static char nomem[] = "Out of memory!\n"; +static const char nomem[] = "Out of memory!\n"; /* paranoid version of malloc */ @@ -81,19 +79,6 @@ safefree(Malloc_t where) free(where); } -/* safe version of string copy */ - -char * -safecpy(char *to, register char *from, register int len) -{ - register char *dest = to; - - if (from != Nullch) - for (len--; len && (*dest++ = *from++); len--) ; - *dest = '\0'; - return to; -} - /* copy a string up to some (non-backslashed) delimiter, if any */ char * @@ -156,7 +141,7 @@ instr(char *big, char *little) char * savestr(char *str) { - register char *newaddr = (char *) safemalloc((MEM_SIZE)(strlen(str)+1)); + register char * const newaddr = (char *) safemalloc((MEM_SIZE)(strlen(str)+1)); (void)strcpy(newaddr,str); return newaddr; @@ -177,21 +162,6 @@ growstr(char **strptr, int *curlen, int newlen) } void -croak(const char *pat,...) -{ -#if defined(HAS_VPRINTF) - va_list args; - - va_start(args, pat); - vfprintf(stderr,pat,args); - va_end(args); -#else - fprintf(stderr,pat,a1,a2,a3,a4); -#endif - exit(1); -} - -void fatal(const char *pat,...) { #if defined(HAS_VPRINTF) |