Bug #5958: Also zero out the implicit pad byte in empty requests.
[free-sw/xcb/libxcb] / src / c-client.xsl
index 0f7c025..5df5762 100644 (file)
@@ -590,7 +590,7 @@ authorization from the authors.
     </list>
   </xsl:template>
 
-  <xsl:template match="field|localfield" mode="param">
+  <xsl:template match="field" mode="param">
     <field>
       <xsl:attribute name="type">
         <xsl:call-template name="canonical-type-name" />
@@ -722,6 +722,10 @@ authorization from the authors.
     <l><xsl:value-of select="@ref" /> xcb_out;</l>
 
     <l />
+    <xsl:if test="not ($ext) and not($struct//*[(self::field or self::exprfield or self::pad)
+                                                and not(boolean(@no-assign))])">
+      <l>xcb_out.pad0 = 0;</l>
+    </xsl:if>
     <xsl:apply-templates select="$struct//*[(self::field or self::exprfield or self::pad)
                                             and not(boolean(@no-assign))]"
                          mode="assign" />