top: place inspect demo buffer on par with read buffer

Both of the 'file' and 'pipe' Inspect read buffers are
always 2048 bytes bigger than is actually needed which
provided for some slightly simplified row paint logic.

However, with no real rcfile inspect entries, and thus
operating in 'demo' mode, the allocated buffer is only
2048 bytes total. This can produce a valgrind warning.

This commit simply puts the inspect 'demo' buffer on a
par with other allocated real buffers (an extra 2048).

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2012-12-23 00:00:00 -06:00 committed by Craig Small
parent 1f1201f896
commit a93f23e6ef

View File

@ -2501,8 +2501,10 @@ static void insp_cnt_nl (void) {
* The pseudo output DEMO utility. */
static void insp_do_demo (char *fmts, int pid) {
(void)fmts; (void)pid;
Insp_bufsz = READMINSZ;
Insp_buf = alloc_c(READMINSZ);
/* next will put us on a par with the real file/pipe read buffers
( and also avoid a harmless, but evil sounding, valgrind warning ) */
Insp_bufsz = READMINSZ + strlen(N_txt(YINSP_dstory_txt));
Insp_buf = alloc_c(Insp_bufsz);
Insp_bufrd = snprintf(Insp_buf, Insp_bufsz, "%s", N_txt(YINSP_dstory_txt));
insp_cnt_nl();
} // end: insp_do_demo