*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getpwent.c,v 1.8 1996/10/16 09:24:21 downsj Exp $";
+static char rcsid[] = "$OpenBSD: getpwent.c,v 1.9 1997/04/13 05:11:07 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
if ((_pw_db->get)(_pw_db, key, &data, 0))
return(0);
p = (char *)data.data;
- if (data.size > max && !(line = realloc(line, (max += 1024))))
- return(0);
+ if (data.size > max) {
+ max = data.size + 256;
+ line = realloc(line, max);
+ if (line == NULL)
+ return 0;
+ }
t = line;
#define EXPAND(e) e = t; while ((*t++ = *p++));
-/* $OpenBSD: inet_pton.c,v 1.1 1997/03/13 19:07:33 downsj Exp $ */
+/* $OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
#if 0
static char rcsid[] = "$From: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.1 1997/03/13 19:07:33 downsj Exp $";
+static char rcsid[] = "$OpenBSD: inet_pton.c,v 1.2 1997/04/13 05:08:24 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
if (new > 255)
return (0);
- *tp = new;
if (! saw_digit) {
if (++octets > 4)
return (0);
saw_digit = 1;
}
+ *tp = new;
} else if (ch == '.' && saw_digit) {
if (octets == 4)
return (0);