Fixed segv if a field that never had buffer 0 set has characters added
to it.
This commit is contained in:
parent
2c20803b63
commit
bcd5895d31
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: internals.c,v 1.4 2001/01/18 05:42:23 blymn Exp $ */
|
||||
/* $NetBSD: internals.c,v 1.5 2001/01/18 23:53:10 blymn Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998-1999 Brett Lymn
|
||||
@ -836,6 +836,14 @@ _formi_add_char(FIELD *field, unsigned int pos, char c)
|
||||
unsigned int new_size;
|
||||
int status;
|
||||
|
||||
/*
|
||||
* If buffer has not had a string before, set it to a blank
|
||||
* string. Everything should flow from there....
|
||||
*/
|
||||
if (field->buffers[0].string == NULL) {
|
||||
set_field_buffer(field, 0, "");
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(dbg, "add_char: pos=%d, char=%c\n", pos, c);
|
||||
fprintf(dbg,
|
||||
|
@ -1,5 +1,5 @@
|
||||
# $NetBSD: shlib_version,v 1.6 2001/01/18 05:42:23 blymn Exp $
|
||||
# $NetBSD: shlib_version,v 1.7 2001/01/18 23:53:10 blymn Exp $
|
||||
# Remember to update distrib/sets/lists/base/shl.* when changing
|
||||
#
|
||||
major=1
|
||||
minor=2
|
||||
minor=3
|
||||
|
Loading…
Reference in New Issue
Block a user