Merge pull request #183 from philave/vs2015-compilation-fix

MS VS2015 compilation fix.
This commit is contained in:
Jaeseung Ha 2017-09-17 18:29:52 +09:00 committed by GitHub
commit c32aae4b5f
2 changed files with 11 additions and 2 deletions

View File

@ -1394,7 +1394,12 @@ namespace crow
case type::Number: case type::Number:
{ {
char outbuf[128]; char outbuf[128];
#ifdef _MSC_VER
sprintf_s(outbuf, 128, "%g", v.d);
#else
sprintf(outbuf, "%g", v.d); sprintf(outbuf, "%g", v.d);
#endif
out += outbuf; out += outbuf;
} }
break; break;

View File

@ -266,8 +266,12 @@ inline char * qs_scanvalue(const char * key, const char * qs, char * val, size_t
{ {
qs++; qs++;
i = strcspn(qs, "&=#"); i = strcspn(qs, "&=#");
strncpy(val, qs, (val_len-1)<(i+1) ? (val_len-1) : (i+1)); #ifdef _MSC_VER
qs_decode(val); strncpy_s(val, val_len, qs, (val_len - 1)<(i + 1) ? (val_len - 1) : (i + 1));
#else
strncpy(val, qs, (val_len - 1)<(i + 1) ? (val_len - 1) : (i + 1));
#endif
qs_decode(val);
} }
else else
{ {