dlbeer / mspdebug

Debugging tool for MSP430 MCUs
GNU General Public License v2.0
190 stars 80 forks source link

Facelift MSPDEBUG_TILIB_PATH handling #76

Closed melak closed 6 years ago

melak commented 6 years ago

Yes, I primarily just want to get rid of strcat (which is checked and appears to be OK, but still, it's 2018).

Also bring behaviour in line with manual and common expectations:

This is in line with both manual and common sense (otherwise one could have just used LD_LIBRARY_PATH).

Poke @DanielO

DanielO commented 6 years ago

Looks good to me, although IMO strcat is fine because it's length checked, I don't really see the snprintf adding any benefit except to satisfy a naive code check.

Note that originally I used asprintf because life is too short but it was rejected because of a concern some platforms might lack it.

melak commented 6 years ago

Yep, no argument about strcat being fine in this particular instance. What I'm after is making the "it's fine" bit more obvious, which is rarely possible with non-bounds-checked string functions, so.

DanielO commented 6 years ago

Fair enough, like I said - looks like it should work to me.

dlbeer commented 6 years ago

Ok, looks good -- thanks.