From 5903bc802ffd0c4a0229ac0b00197f8f0f52f478 Mon Sep 17 00:00:00 2001 From: David Nugent Date: Sun, 11 May 1997 08:07:29 +0000 Subject: MF2.2: bugfix in arrayize(). --- libutil/login_cap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libutil') diff --git a/libutil/login_cap.c b/libutil/login_cap.c index 633da20..b1761ec 100644 --- a/libutil/login_cap.c +++ b/libutil/login_cap.c @@ -25,7 +25,7 @@ * * Low-level routines relating to the user capabilities database * - * $Id: login_cap.c,v 1.11 1997/02/27 00:24:05 ache Exp $ + * $Id: login_cap.c,v 1.12 1997/05/10 18:55:37 davidn Exp $ */ #include @@ -115,13 +115,13 @@ arrayize(char *str, const char *chars, int *size) ++ptr; } - i = 0; /* alloc the array */ if ((ptr = allocstr(str)) != NULL) { if ((res = allocarray(++i)) == NULL) free(str); else { /* now split the string */ + i = 0; while (*ptr) { int count = strcspn(ptr, chars); res[i++] = ptr; -- cgit v1.2.3-56-ge451