A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/eclipse/paho.mqtt.cpp/issues/317 below:

v1.2 ssl_options:on_error string init not recommended · Issue #317 · eclipse-paho/paho.mqtt.cpp · GitHub

Hi, testing integrating the new Paho 1.2, thx for the update!

I checked the new method for the SSL error to replace ours, and I saw something that could give warning as uselessly doing pointer arithmetic (not recommended in modern C++)
Such warning could be enforced by gcc warning option (sorry, not in my mind tonight) or got via some static checker tool.

In ssl_options:on_error()
string errMsg { str, str+len };

Also I am not sure what ctor it uses.

This would be safer to use the simple ctor (ptr, len)
basic_string( const CharT* s,
size_type count,
const Allocator& alloc = Allocator() );

so here:
string errMsg { str, len };

This one do not generate any warning as no pointer arithmetic.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4