<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'><div>Hi, Matthias.</div><div><br></div><div>I think it is unneeded and can be removed.<br></div><div><br></div>----- matthias.baesken@sap.com wrote:
<br>> 



<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:DE;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->

<div lang="DE">> 
<div class="WordSection1">> 
<p class="MsoNormal"><span lang="EN-US">Hello,   is there a special reason to put  a  '\0'  at the end of  the   “atom_name”  - parameter  of the XInternAtom call in  isXCompositeDisplay  ?</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal">jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c :</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">static jboolean isXCompositeDisplay(Display *display, int screenNumber) {</span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">    </span>char NET_WM_CM_Sn[25];</p>
<p class="MsoNormal" style="margin-left:35.4pt">    <span lang="EN-US">snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);</span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US">    Atom managerSelection = XInternAtom(display, NET_WM_CM_Sn, 0);</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I think on UNIX  the snprintf implementations  are conforming and zero-terminate  ( exception was VS before VS2015   but this  is  unix/native  code ).</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Reason why I ask is this warning we  have  in our AIX xlc16/xlclang  build  :</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c:153:65: warning: format string contains '\0' within the string body [-Wformat]</span></p>
<p class="MsoNormal"><span lang="EN-US">    snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks, Matthias</span></p>
</div>
</div>

</div></body></html>