frankjoshua / rosserial_arduino_lib

56 stars 46 forks source link

Confused by string copies #26

Open gcl8a opened 2 weeks ago

gcl8a commented 2 weeks ago

The latest library has the following lines in RequestParam.h:

    virtual const char * getType(const char * type_msg) override { strcpy_P(type_msg, (char *)REQUESTPARAM);return type_msg; };
    virtual const char * getMD5(const char * md5_msg) override { strcpy_P(md5_msg, (char *)rosserial_msgs_RequestParamResponse_md5);return md5_msg; };

which are causing compile errors. Both functions appear to be copying into const char* variables.

I feel like I'm missing something obvious, because I don't see how this would ever work.

frankjoshua commented 2 weeks ago

Maybe one of the pull requests caused an issue. I can't check right now. See if an earlier commit works for you. Then let me know the hash.

On Sun, Sep 1, 2024, 7:20 AM Greg Lewin @.***> wrote:

The latest library has the following lines in RequestParam.h:

virtual const char * getType(const char * type_msg) override { strcpy_P(type_msg, (char *)REQUESTPARAM);return type_msg; };
virtual const char * getMD5(const char * md5_msg) override { strcpy_P(md5_msg, (char *)rosserial_msgs_RequestParamResponse_md5);return md5_msg; };

which are causing compile errors. Both functions appear to be copying into const char* variables.

I feel like I'm missing something obvious, because I don't see how this would ever work.

— Reply to this email directly, view it on GitHub https://github.com/frankjoshua/rosserial_arduino_lib/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABYKCXMZ6YPBGGWWC6F5KLZUMBALAVCNFSM6AAAAABNOZIKHCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TSNBTGYZDCNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>