Fix win32 cltool.

This commit is contained in:
Pavel Krajcevski 2013-10-02 11:56:36 -04:00
parent 8e555b8424
commit 5b0ede3239

View File

@ -70,8 +70,8 @@ void PrintUsage() {
fprintf(stderr, "\t-j <num>\tUse <num> blocks for each work item in a worker queue threading model. Default: (Blocks / Threads)\n");
}
void ExtractBasename(const char *filename, char *buf, int bufSz) {
int len = strlen(filename);
void ExtractBasename(const char *filename, char *buf, size_t bufSz) {
size_t len = strlen(filename);
const char *end = filename + len;
const char *ext = end;
const char *base = NULL;
@ -83,8 +83,8 @@ void ExtractBasename(const char *filename, char *buf, int bufSz) {
}
}
int numChars = ext - base + 1;
int toCopy = ::std::min(numChars, bufSz);
size_t numChars = ext - base + 1;
size_t toCopy = (::std::min)(numChars, bufSz);
memcpy(buf, base, toCopy);
buf[toCopy - 1] = '\0';
return;