compuphase / minIni

A small and portable INI file library with read/write support
http://www.compuphase.com/minini.htm
Other
382 stars 114 forks source link

wrong assert in save_strncpy #7

Closed skycetus closed 7 years ago

skycetus commented 7 years ago

This code at beginning of save_strncpy has an error: assert(dest <= source || dest >= source + maxlen);

Because maxlen is a target attribute I expect somewhat like in second part: dest > source + strlen(source) For example, ini_gets fails if Buffer placed in memory immediatelly after very short DefValue.

Also, I expect that dest should be filled by '\', when both option == QUOTE_ENQUOTE and dest == source.

compuphase commented 7 years ago

Fixed in commit 77908366d4c0a758e33c4c6f39a29eba836ae7dd. Thank you for the report.