Re: [PATCH:xman 1/2] Fix tautology to the intended check.
Am 23.05.2014 07:44, schrieb Alan Coopersmith: On 05/21/14 03:17 PM, Thomas Klausner wrote: From: Jörg Sonnenberger jo...@netbsd.org Signed-off-by: Thomas Klausner w...@netbsd.org --- handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.c b/handler.c index e61687e..87a928e 100644 --- a/handler.c +++ b/handler.c @@ -320,7 +320,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, * If we are not active then take no action. */ -if (man_globals-tempfile == NULL) +if (man_globals-tempfile[0] == '\0') return; switch (params[0][0]) { Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com Hi, IMHO this is not equal, can you explain that NULL is not possible ? re, wh ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xman 1/2] Fix tautology to the intended check.
On Fri, May 23, 2014 at 10:10:19AM +0200, walter harms wrote: Am 23.05.2014 07:44, schrieb Alan Coopersmith: On 05/21/14 03:17 PM, Thomas Klausner wrote: From: Jörg Sonnenberger jo...@netbsd.org Signed-off-by: Thomas Klausner w...@netbsd.org --- handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.c b/handler.c index e61687e..87a928e 100644 --- a/handler.c +++ b/handler.c @@ -320,7 +320,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, * If we are not active then take no action. */ -if (man_globals-tempfile == NULL) +if (man_globals-tempfile[0] == '\0') return; switch (params[0][0]) { Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com Hi, IMHO this is not equal, can you explain that NULL is not possible ? Look at the definition of man_globals, its type is ManpageGlobals, and the tempfile member of ManpageGlobals is declared this way: char tempfile[80]; Since tempfile is a fixed-size array, it can never be a NULL pointer, so the comparison as-is doesn't make sense. Thomas ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH:xman 1/2] Fix tautology to the intended check.
Am 23.05.2014 17:09, schrieb Thomas Klausner: On Fri, May 23, 2014 at 10:10:19AM +0200, walter harms wrote: Am 23.05.2014 07:44, schrieb Alan Coopersmith: On 05/21/14 03:17 PM, Thomas Klausner wrote: From: Jörg Sonnenberger jo...@netbsd.org Signed-off-by: Thomas Klausner w...@netbsd.org --- handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.c b/handler.c index e61687e..87a928e 100644 --- a/handler.c +++ b/handler.c @@ -320,7 +320,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, * If we are not active then take no action. */ -if (man_globals-tempfile == NULL) +if (man_globals-tempfile[0] == '\0') return; switch (params[0][0]) { Reviewed-by: Alan Coopersmith alan.coopersm...@oracle.com Hi, IMHO this is not equal, can you explain that NULL is not possible ? Look at the definition of man_globals, its type is ManpageGlobals, and the tempfile member of ManpageGlobals is declared this way: char tempfile[80]; Since tempfile is a fixed-size array, it can never be a NULL pointer, so the comparison as-is doesn't make sense. Thomas yes i see it now, sorry for the noise re, wh ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH:xman 1/2] Fix tautology to the intended check.
From: Jörg Sonnenberger jo...@netbsd.org Signed-off-by: Thomas Klausner w...@netbsd.org --- handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handler.c b/handler.c index e61687e..87a928e 100644 --- a/handler.c +++ b/handler.c @@ -320,7 +320,7 @@ SaveFormattedPage(Widget w, XEvent * event, String * params, * If we are not active then take no action. */ -if (man_globals-tempfile == NULL) +if (man_globals-tempfile[0] == '\0') return; switch (params[0][0]) { -- 1.9.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel