fix a comment in nano.h and a minor memory leak in display_string()

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3271 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-02-03 03:51:51 +00:00
parent 66d3ebf6a6
commit 1f104f8079
3 changed files with 6 additions and 3 deletions

View File

@ -35,6 +35,8 @@ CVS code -
fixes a potential display problem when a search moves the
cursor offscreen and onto a different page. (DLR, found by
Mike Frysinger)
display_string()
- Fix minor memory leak. (DLR)
- doc/nano.1:
- Better display the default values for quotestr. (DLR)
- doc/nanorc.5:

View File

@ -590,7 +590,7 @@ typedef struct rcoption {
* counting the blank lines at their ends. */
#define MAX_SEARCH_HISTORY 100
/* The maximum number of bytes we read from a file at one time. */
/* The maximum number of bytes we read into a buffer at one time. */
#define MAX_BUF_SIZE 128
#endif /* !NANO_H */

View File

@ -1791,8 +1791,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
/* The string we return. */
size_t index;
/* Current position in converted. */
char *buf_mb = charalloc(mb_cur_max());
char *buf_mb;
int buf_mb_len;
/* If dollars is TRUE, make room for the "$" at the end of the
@ -1803,6 +1802,8 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
if (len == 0)
return mallocstrcpy(NULL, "");
buf_mb = charalloc(mb_cur_max());
start_index = actual_x(buf, start_col);
column = strnlenpt(buf, start_index);