edorfaus / TEMPered

C library and program for reading the TEMPer family of thermometer and hygrometer devices.
http://edorfaus.wordpress.com/
BSD 2-Clause "Simplified" License
87 stars 50 forks source link

Fixes libtempered error string handling #44

Closed mwerezak closed 1 year ago

mwerezak commented 8 years ago

A library should NEVER ask an application to free dynamically allocated memory. Unless the library is statically linked to the application, there is no guarantee that a free() in the application will line up with a malloc() in the library.

See this discussion, for example.

This PR removes the dynamically allocated error message strings and instead writes the messages to a caller specified buffer.

mwerezak commented 1 year ago

Looks like this repo is long dead. If anyone is interested in the updated code, please see https://github.com/mwerezak/TEMPered