diff options
author | joerg <joerg> | 2006-06-08 15:39:25 +0000 |
---|---|---|
committer | joerg <joerg> | 2006-06-08 15:39:25 +0000 |
commit | 71b0b852c7435dbb8c0f5a0b7ad20662fa119f6c (patch) | |
tree | 215dad15d08d5392f5c54389c9ef46b23e005e02 /sysutils/xdu/patches/patch-aa | |
parent | eebea6ec05eba17c243c0f076d423fcf9c3bb54d (diff) | |
download | pkgsrc-71b0b852c7435dbb8c0f5a0b7ad20662fa119f6c.tar.gz |
Kill local strdup completely and also remove the malloc and calloc
definitions. ANSI C is portable enough for us.
Diffstat (limited to 'sysutils/xdu/patches/patch-aa')
-rw-r--r-- | sysutils/xdu/patches/patch-aa | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/sysutils/xdu/patches/patch-aa b/sysutils/xdu/patches/patch-aa index 5ab96cb614d..fe53abcf0dc 100644 --- a/sysutils/xdu/patches/patch-aa +++ b/sysutils/xdu/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ +$NetBSD: patch-aa,v 1.5 2006/06/08 15:39:25 joerg Exp $ ---- xdu.c.orig 2005-07-11 23:15:31.000000000 +0200 -+++ xdu.c 2005-07-11 23:19:59.000000000 +0200 -@@ -19,13 +19,15 @@ +--- xdu.c.orig 2006-06-08 15:35:16.000000000 +0000 ++++ xdu.c +@@ -19,13 +19,13 @@ * limitation a license to do the foregoing actions under any patents of * the party supplying this software to the X Consortium. */ @@ -11,8 +11,8 @@ $NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ +#include <string.h> #include "version.h" - extern char *malloc(), *calloc(); - +-extern char *malloc(), *calloc(); +- -#define MAXDEPTH 80 /* max elements in a path */ -#define MAXNAME 1024 /* max pathname element length */ +#define MAXDEPTH 1024 /* max elements in a path */ @@ -20,7 +20,7 @@ $NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ #define MAXPATH 4096 /* max total pathname length */ #define NCOLS 5 /* default number of columns in display */ -@@ -96,6 +98,10 @@ +@@ -96,6 +96,10 @@ int size; struct node *np; np = (struct node *)calloc(1,sizeof(struct node)); @@ -31,27 +31,24 @@ $NetBSD: patch-aa,v 1.4 2005/07/12 20:16:00 hubertf Exp $ np->name = strdup(name); np->size = size; np->num = nnodes; -@@ -610,6 +616,7 @@ +@@ -610,20 +614,6 @@ pwd() 100.0*topp->size/rootp->size); } -+#if !defined(__NetBSD__) && !defined(SVR4) /* == Solaris etc. */ - char * - strdup(s) - char *s; -@@ -619,10 +626,15 @@ - - n = strlen(s); - cp = malloc(n+1); -+ if (cp == NULL) { -+ fprintf(stderr, "Out of memory! (#2)\n"); -+ exit(1); -+ } - strcpy(cp,s); - - return cp; - } -+#endif /* __NetBSD__ */ - +-char * +-strdup(s) +-char *s; +-{ +- int n; +- char *cp; +- +- n = strlen(s); +- cp = malloc(n+1); +- strcpy(cp,s); +- +- return cp; +-} +- /**************** External Entry Points ****************/ + int |