@@ -78,8 +78,18 @@ #include "freexl.h" #include "freexl_internals.h" + +const char *freexlversion = VERSION; + +FREEXL_DECLARE const char * +freexl_version (void) +{ +/* return the library version number */ + return freexlversion; +} + #if defined(_WIN32) && !defined(__MINGW32__) /* MSVC compiler doesn't support lround() at all */ static double round (double num) @@ -3758,9 +3768,9 @@ /* the current record spans on the following sector(s) */ unsigned int already_done; unsigned int chunk = workbook->sector_end - (workbook->p_in - workbook->sector_buf); - if (workbook->sector_end <= (workbook->p_in - workbook->sector_buf)) + if (workbook->sector_end < (workbook->p_in - workbook->sector_buf)) return -1; memcpy (workbook->record, workbook->p_in, chunk); workbook->p_in += chunk; already_done = chunk;