|
From: | dmitry maybe |
Subject: | Re: Dialog editbox bug |
Date: | Sat, 1 Jun 2019 13:44:09 +0000 |
Can you please provide a complete working source code for your current problem?On Sat, 1 Jun 2019, 13:58 dmitry maybe, <address@hidden> wrote:I still it seems like a bug.So, while debugged, see two crashes cases:1)After pressed key many times at the same line,for example "ddddddddddddddddddddddddddddddddddddddddddddddd....."I've got Segmentation fault in inputsr.c in compare_cache function at line: int result = CMP(p->cache_num, q->cache_num) (line 130)2)After input relatively long line,I've got program crash in editbox.c file in function dlg_editbox at line: free(buffer); (line 744)On Fri, May 31, 2019 at 9:17 AM dmitry maybe <address@hidden> wrote:Thank you!But why characters are showing up as ^@'s ?On Fri, May 31, 2019 at 8:56 AM Thomas Dickey <address@hidden> wrote:On Fri, May 31, 2019 at 02:02:17AM +0200, Stian Skjelstad wrote:
> On Fri, 31 May 2019, 01:02 dmitry maybe, <address@hidden> wrote:
>
> >
> > char **list;
> > list = (char **) malloc(2+1);
> >
>
> list=(char **)malloc(2*sizeof(char *));
perhaps (that seems to be a response to something off-list).
Before looking inside dialog, I'm looking for something that I
can compile and run, so that I can use valgrind (and compiler)
to show me where to look for the actual problem.
The example still has a typo (the ":" in the declaration for tmp_status
should be a ";"), but fixing and compiling that and running it, I don't see
a problem in valgrind:
> g++-min -g -o foo2 foo2.cpp -I/usr/build/ncurses/foo2.cpp -L/usr/build/ncurses/foo2.cpp -ldialog `ncursesw6dev-config --cflags --libs`
cc1plus: warning: /usr/build/ncurses/foo2.cpp: not a directory
foo2.cpp: In function ‘int main(int, char**)’:
foo2.cpp:10:38: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dlg_items_ip[0].name = "Server:";
^
foo2.cpp:12:38: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dlg_items_ip[0].text = "" ;
^
foo2.cpp:32:72: warning: operation on ‘status’ may be undefined [-Wsequence-point]
status = status=dialog_editbox("Post",input_post,20,30);
^
foo2.cpp:28:5: warning: variable ‘tmp_status’ set but not used [-Wunused-but-set-variable]
int tmp_status;
^
The example shows some problems on the screen which I suppose are due
to problems in the sample code, since the line-drawing characters are
showing up as ^@'s.
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
[Prev in Thread] | Current Thread | [Next in Thread] |