Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: JSON produces incorrect empty array when compiled on Mac.

$
0
0
This is a legit bug (json.h, v1.4.0):
            template<typename CharType>
            void format_impl(std::basic_string<CharType>& str) const
            {
                str.push_back('[');
                for (auto iter = m_elements.begin(); iter != m_elements.end(); ++iter)
                {
                    iter->second.format(str);
                    str.push_back(',');
                }
                str[str.size() - 1] = ']';
            }
The code tries to replace the last ',' character with the closing square bracket (']') but ends up replacing the opening bracket if there are no elements in the array.

Casablanca folks,
Can you please acknowledge?

Yiannis

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>