All pastes #2053581 Raw Edit

test001

public text v1 · immutable
#2053581 ·published 2011-05-03 19:39 UTC
rendered paste body
Index: common/misc/cmdarg.c===================================================================--- common/misc/cmdarg.c	(revision 2374)+++ common/misc/cmdarg.c	(working copy)@@ -53,12 +53,12 @@ cmdopen(char** argv, int argmax, int size, const char* argpat, int flags) { 	register Cmdarg_t*	cmd;-	register int		n;+	register long		n; 	register char**		p; 	register char*		s; 	char*			sh; 	int			c;-	int			m;+	long			m; 	int			argc; 	long			x; @@ -102,11 +102,17 @@ 		size = x - m; 	n = size - n; 	m = ((flags & CMD_INSERT) && argpat) ? (strlen(argpat) + 1) : 0;-	if (!(cmd = newof(0, Cmdarg_t, 1, n + m)))+	if (!(cmd = ((Cmdarg_t*)malloc((sizeof(Cmdarg_t)*(1L)+(n+m)))))) 	{ 		error(ERROR_SYSTEM|2, "out of space"); 		return 0; 	}+      {+              char*   xp = (char*)cmd;+              int     xn = sizeof(Cmdarg_t)*(1)+(n+m);+              while (xn)+                      xp[--xn] = 0;+      } 	c = n / sizeof(char**); 	if (argmax <= 0 || argmax > c) 		argmax = c;