[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: Re: [OpenJDK 2D-Dev] RFR: [XXS] 8228468: awt_Robot.c : format string contains 0 within the string bo
From: Sergey Bylokhov <Sergey.Bylokhov () oracle ! com>
Date: 2019-07-22 21:22:08
Message-ID: dab55362-66f5-41c2-e859-3162a800d883 () oracle ! com
[Download RAW message or body]
Looks fine.
On 22/07/2019 01:26, Baesken, Matthias wrote:
> Hi Sergey, thanks for the reply !
>
> I created a bug + webrev . Please review .
>
> https://bugs.openjdk.java.net/browse/JDK-8228468
>
> http://cr.openjdk.java.net/~mbaesken/webrevs/8228468.0/
>
> Best regards, Matthias
>
> *From:*Sergey Bylokhov <sergey.bylokhov@oracle.com>
> *Sent:* Freitag, 19. Juli 2019 23:06
> *To:* Baesken, Matthias <matthias.baesken@sap.com>
> *Cc:* awt-dev@openjdk.java.net; 2d-dev@openjdk.java.net
> *Subject:* Re: <AWT Dev> awt_Robot.c : format string contains '\0' within the \
> string body
> Hi, Matthias.
>
> I think it is unneeded and can be removed.
>
> ----- matthias.baesken@sap.com <mailto:matthias.baesken@sap.com> wrote:
> >
>
> >
>
> >
>
> Hello, is there a special reason to put a '\0' at the end of the \
> "atom_name" - parameter of the XInternAtom call in isXCompositeDisplay ?
> jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c :
>
> static jboolean isXCompositeDisplay(Display *display, int screenNumber) {
>
> char NET_WM_CM_Sn[25];
>
> snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
>
> Atom managerSelection = XInternAtom(display, NET_WM_CM_Sn, 0);
>
> I think on UNIX the snprintf implementations are conforming and zero-terminate \
> ( exception was VS before VS2015 but this is unix/native code ).
> Reason why I ask is this warning we have in our AIX xlc16/xlclang build :
>
> /jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:153:65: warning: \
> format string contains '\0' within the string body [-Wformat]
> snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
>
> Thanks, Matthias
>
--
Best regards, Sergey.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic