- Fix problem where replacing e.g. single-byte characters with
multibyte ones could result in openfile->totsize's being
miscalculated. (DLR)
+- utils.c:
+ ngetline(), ngetdelim()
+ - Update copyright notice to account for modifications. (DLR)
+ ngetdelim()
+ - Simplify. (DLR)
- winio.c:
get_key_buffer()
- Fix inaccurate comments. (DLR)
* Foundation's address updated:
*
* GNU Mailutils -- a suite of utilities for electronic mail
- * Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ * Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free
+ * Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
/* Allocate the line the first time. */
if (*lineptr == NULL) {
- *lineptr = charalloc(MAX_BUF_SIZE);
*n = MAX_BUF_SIZE;
+ *lineptr = charalloc(*n);
}
while ((c = getc(stream)) != EOF) {
/* Check if more memory is needed. */
if (indx >= *n) {
- *lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
*n += MAX_BUF_SIZE;
+ *lineptr = charealloc(*lineptr, *n);
}
/* Put the result in the line. */
/* Make room for the null character. */
if (indx >= *n) {
- *lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
*n += MAX_BUF_SIZE;
+ *lineptr = charealloc(*lineptr, *n);
}
/* Null-terminate the buffer. */