Conversation
I'll let the compiler speak for itself: ioapi.c(201): error C2664: 'char *strncpy(char *,const char *,std::size_t)': cannot convert argument 2 from 'void *' to 'const char *' ioapi.c(201): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast A trivial fix, this is.
|
Why not change "void *filename" to "char *filename" in the struct? |
|
Yes, that would probably be better still. I've simply chosen to do the casting because the surrounding code does the same, including the API (cf. lines 122-123, 146 etc.). I can't see any reason to use a |
|
I saw the lines above your changes and there the malloc-result is casted to (char *) so I think it was changed later to void... |
|
Digging through history, it's been like this since January 2012 (commit 6d35b6b; also, GitHub is very shitty at displaying this diff for whatever reason, I had to use an external tool to view it 😕). Apparently, this data structure is used for generating part-numbered filenames for archives spanning multiple disks. I'm all for changing the field type instead, but I'd like a project maintainer to weigh in first. :) |
|
Change looks good. |
|
@nmoinvaz Great! Can we expect it to be merged? |
|
Thank you! |
I'm compiling minizip in my project by #including its source code inline (namely,
unzip.candioapi.c) in MSVC 2015. I'll let the compiler speak for itself:There are two more in the same vein. This PR is a trivial fix for these errors.