<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: vsnprintf is not working properly on HP-UX Itanium in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410249#M663485</link>
    <description>Thanks a lot Guys for your reply.&lt;BR /&gt;&lt;BR /&gt;about OS version :&lt;BR /&gt;the o/p of uname -a is&lt;BR /&gt;HP-UX hermes B.11.23 U ia64 2917453674 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;It means os version is 11.23&lt;BR /&gt;&lt;BR /&gt;@Dennis&lt;BR /&gt;&amp;gt; I thought I've seen a bug where it writes one byte but not more?&lt;BR /&gt;&lt;BR /&gt;In my case case it is writing more than one byte&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I'm not sure if there is a bug report for this for 11.23?&lt;BR /&gt;Can you please confirm me whether this is a known bug for 11.23?&lt;BR /&gt;So that next path is clear &lt;BR /&gt;&lt;BR /&gt;As you said,vsnprintf will not work correctly unless you are on 11.31 and the os version which I am working on is 11.23.&lt;BR /&gt;&lt;BR /&gt;So the question is how should I upgrade this os version?(ofcourse by applying patch)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;@SEP:&lt;BR /&gt;&amp;gt;You might try a bi-annual patch update&lt;BR /&gt;where is this patch located(exact location)?&lt;BR /&gt;&lt;BR /&gt;Before doing this,is there any alternative function available for vsnprintf function?&lt;BR /&gt;So that I can use it in my case&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Thu, 30 Apr 2009 05:30:51 GMT</pubDate>
    <dc:creator>girishgawali</dc:creator>
    <dc:date>2009-04-30T05:30:51Z</dc:date>
    <item>
      <title>vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410245#M663481</link>
      <description>Below is code snippet:&lt;BR /&gt;&lt;BR /&gt;  void test_emptyBuffer()&lt;BR /&gt;    {&lt;BR /&gt;        const o_4b stringLengthWithoutNull = 4;&lt;BR /&gt;        const o_4b bufferSize = 0;&lt;BR /&gt;        char buf[2];&lt;BR /&gt;        clearBuffer(buf, 2);&lt;BR /&gt;&lt;BR /&gt;        o_4b returnValue = vs_snprintf(buf, (size_t) bufferSize, "%s", "emil");&lt;BR /&gt;        cout&amp;lt;&amp;lt; "returnValue is:"&amp;lt;&amp;lt; returnValue &amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;        cout&amp;lt;&amp;lt; "buf is:"&amp;lt;&amp;lt; buf&amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;        string resultString = string(buf);&lt;BR /&gt;        cout&amp;lt;&amp;lt; "resultString is:"&amp;lt;&amp;lt; resultString&amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;        string expectedString = string("*");&lt;BR /&gt;        cout&amp;lt;&amp;lt; "expectedString is:"&amp;lt;&amp;lt; expectedString&amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;        TS_ASSERT_EQUAL_STRINGS(resultString, expectedString,  "unmodified buffer");&lt;BR /&gt;        TS_ASSERT_EQUALS(returnValue, stringLengthWithoutNull, "return value");&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;vs_snprintf is Wrapper for the functions vsnprintf &lt;BR /&gt;&lt;BR /&gt;o_4b vs_snprintf(char *buf, size_t count, char* format, ...)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;    va_list argp;&lt;BR /&gt;    va_start(argp, format);&lt;BR /&gt;    o_4b result = 0;&lt;BR /&gt;&lt;BR /&gt;    result =  vsnprintf(buf, count, format, argp);&lt;BR /&gt;    va_end(argp);&lt;BR /&gt;&lt;BR /&gt;    if (result &amp;lt; 0)&lt;BR /&gt;    {&lt;BR /&gt;        va_start(argp, format);&lt;BR /&gt;        result = vs_scprintfInternal(format, argp);&lt;BR /&gt;        va_end(argp);&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;    return result;&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;After running this program:&lt;BR /&gt;&lt;BR /&gt;even if the bufferSize is 0 (means count is 0) ,vs_snprintf(ultimately vsnprintf) function write "emil" string into the buf &lt;BR /&gt;&lt;BR /&gt;Why is it so?&lt;BR /&gt;It should not write anything into the buf as we are specifying bufferSize as zero&lt;BR /&gt;&lt;BR /&gt;fyi ...&lt;BR /&gt;Below are the more values &lt;BR /&gt;returnValue is:4&lt;BR /&gt;resultString is:emil&lt;BR /&gt;expectedString is:*&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Apr 2009 11:48:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410245#M663481</guid>
      <dc:creator>girishgawali</dc:creator>
      <dc:date>2009-04-29T11:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410246#M663482</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Perhaps grace us with your OS version.&lt;BR /&gt;&lt;BR /&gt;You might try a bi-annual patch update or search the &lt;A href="http://itrc.hp.com" target="_blank"&gt;http://itrc.hp.com&lt;/A&gt; batch database for a patch that applies to the command you are using.&lt;BR /&gt;&lt;BR /&gt;You might try updating your development libraries.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 29 Apr 2009 11:59:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410246#M663482</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-04-29T11:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410247#M663483</link>
      <description>&amp;gt;even if the bufferSize is 0 (means count is 0), vsnprintf function writes "emil" string into the buf&lt;BR /&gt;&amp;gt;It should not write anything into the buf as we are specifying bufferSize as zero&lt;BR /&gt;&lt;BR /&gt;I thought I've seen a bug where it writes one byte but not more?&lt;BR /&gt;&lt;BR /&gt;As SEP said, you need to mention the OS version.  vsnprintf(3) will not work correctly unless you are on 11.31 and you ask for Unix 2003 branding.  But writing to the buffer with length zero, shouldn't be one of the accepted results.</description>
      <pubDate>Wed, 29 Apr 2009 15:34:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410247#M663483</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-04-29T15:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410248#M663484</link>
      <description>I went to enter your test case and found I already had a test case with that name and for the same error.  ;-)&lt;BR /&gt;&lt;BR /&gt;This was discussed in:&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1320687" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1320687&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'm not sure if there is a bug report for this for 11.23?  It works for 11.31.</description>
      <pubDate>Thu, 30 Apr 2009 00:48:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410248#M663484</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-04-30T00:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410249#M663485</link>
      <description>Thanks a lot Guys for your reply.&lt;BR /&gt;&lt;BR /&gt;about OS version :&lt;BR /&gt;the o/p of uname -a is&lt;BR /&gt;HP-UX hermes B.11.23 U ia64 2917453674 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;It means os version is 11.23&lt;BR /&gt;&lt;BR /&gt;@Dennis&lt;BR /&gt;&amp;gt; I thought I've seen a bug where it writes one byte but not more?&lt;BR /&gt;&lt;BR /&gt;In my case case it is writing more than one byte&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I'm not sure if there is a bug report for this for 11.23?&lt;BR /&gt;Can you please confirm me whether this is a known bug for 11.23?&lt;BR /&gt;So that next path is clear &lt;BR /&gt;&lt;BR /&gt;As you said,vsnprintf will not work correctly unless you are on 11.31 and the os version which I am working on is 11.23.&lt;BR /&gt;&lt;BR /&gt;So the question is how should I upgrade this os version?(ofcourse by applying patch)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;@SEP:&lt;BR /&gt;&amp;gt;You might try a bi-annual patch update&lt;BR /&gt;where is this patch located(exact location)?&lt;BR /&gt;&lt;BR /&gt;Before doing this,is there any alternative function available for vsnprintf function?&lt;BR /&gt;So that I can use it in my case&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 30 Apr 2009 05:30:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410249#M663485</guid>
      <dc:creator>girishgawali</dc:creator>
      <dc:date>2009-04-30T05:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410250#M663486</link>
      <description>&amp;gt;Can you please confirm me whether this is a known bug for 11.23?&lt;BR /&gt;&lt;BR /&gt;I'm not sure if it was ever reported.  Or if it was and only fixed on 11.31?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;So the question is how should I upgrade this OS version? (of course by applying patch)&lt;BR /&gt;&lt;BR /&gt;11.31 is a whole NEW OS version.  No patching possible.  (Unless you contact the Response Center and you report the problem.)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;is there any alternative function available for vsnprintf function?&lt;BR /&gt;&lt;BR /&gt;Not really.  Unless you check for length 0 and allocate/then free some "large" buffer.</description>
      <pubDate>Thu, 30 Apr 2009 06:57:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410250#M663486</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-04-30T06:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410251#M663487</link>
      <description>&amp;gt;Unless you check for length 0 and allocate/then free some "large" buffer.&lt;BR /&gt;&lt;BR /&gt;I am not getting what you are trying to say.&lt;BR /&gt;Can you please explain it more?&lt;BR /&gt;(Does this resolve the problem?)</description>
      <pubDate>Thu, 30 Apr 2009 09:45:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410251#M663487</guid>
      <dc:creator>girishgawali</dc:creator>
      <dc:date>2009-04-30T09:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410252#M663488</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;In reply to your @SEP&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www11.itrc.hp.com/service/patch/mainPage.do" target="_blank"&gt;http://www11.itrc.hp.com/service/patch/mainPage.do&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That is the patch database. There are links to the bi-annual patch sets on that site.&lt;BR /&gt;&lt;BR /&gt;The best download method if possible is ftp script.&lt;BR /&gt;&lt;BR /&gt;Also note that the site is very good at building larger patch sets that include needed dependent patches.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 30 Apr 2009 09:48:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410252#M663488</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-04-30T09:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410253#M663489</link>
      <description>Shalom again,&lt;BR /&gt;&lt;BR /&gt;Another thing to think about on the patching front is SWA.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B6834AA" target="_blank"&gt;http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B6834AA&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This is a very helpful tool in building patch sets.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 30 Apr 2009 10:23:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410253#M663489</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-04-30T10:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410254#M663490</link>
      <description>&amp;gt;I am not getting what you are trying to say. Can you please explain it more?&lt;BR /&gt;&lt;BR /&gt;char *p = buf;&lt;BR /&gt;char big_buf[1024];&lt;BR /&gt;if (count == 0)  // workaround&lt;BR /&gt;   p = big_buf;&lt;BR /&gt;   &lt;BR /&gt;result = vsnprintf(p, count, format, argp);&lt;BR /&gt;va_end(argp); &lt;BR /&gt;&lt;BR /&gt;&amp;gt;Does this resolve the problem?&lt;BR /&gt;&lt;BR /&gt;No, it works around the problem, a kludge.</description>
      <pubDate>Fri, 01 May 2009 04:31:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410254#M663490</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-01T04:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410255#M663491</link>
      <description>this workaround helps me.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot</description>
      <pubDate>Mon, 04 May 2009 08:41:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410255#M663491</guid>
      <dc:creator>girishgawali</dc:creator>
      <dc:date>2009-05-04T08:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410256#M663492</link>
      <description>Is that problem related to the buffer size. Where is the working limit?&lt;BR /&gt;Thanks,&lt;BR /&gt;Guido</description>
      <pubDate>Tue, 12 May 2009 07:06:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410256#M663492</guid>
      <dc:creator>Guido  Rost</dc:creator>
      <dc:date>2009-05-12T07:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: vsnprintf is not working properly on HP-UX Itanium</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410257#M663493</link>
      <description>&amp;gt;Guido: Is that problem related to the buffer size. Where is the working limit?&lt;BR /&gt;&lt;BR /&gt;Just with length 0.  Otherwise you need a buffer as large as you need.</description>
      <pubDate>Tue, 12 May 2009 15:11:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vsnprintf-is-not-working-properly-on-hp-ux-itanium/m-p/4410257#M663493</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-05-12T15:11:01Z</dc:date>
    </item>
  </channel>
</rss>

