sparkfun / OpenLog

Open Source Hardware Datalogger
https://www.sparkfun.com/products/9530
Other
547 stars 215 forks source link

Fixed returning pointer to local array. #189

Closed ystark closed 8 years ago

ystark commented 9 years ago

new_file_name is a local array, it is valid only within its scope (function newlog()). If you return the pointer and access it later you get undefined behavior.

nseidle commented 8 years ago

Hi ystark - Sorry it took awhile to get back to you. Thanks for finding this bug. It popped its head up while I was trying to get version 4 put together. You saved me a ton of time. Thank you! Your fix is in the latest version.