diff --git a/include/crow/json.h b/include/crow/json.h index 8b58180c7..e2d116c5c 100644 --- a/include/crow/json.h +++ b/include/crow/json.h @@ -1394,7 +1394,12 @@ namespace crow case type::Number: { char outbuf[128]; +#ifdef _MSC_VER + sprintf_s(outbuf, 128, "%g", v.d); +#else sprintf(outbuf, "%g", v.d); +#endif + out += outbuf; } break; diff --git a/include/crow/query_string.h b/include/crow/query_string.h index 78ccc677f..ee61e30af 100644 --- a/include/crow/query_string.h +++ b/include/crow/query_string.h @@ -266,8 +266,12 @@ inline char * qs_scanvalue(const char * key, const char * qs, char * val, size_t { qs++; i = strcspn(qs, "&=#"); - strncpy(val, qs, (val_len-1)<(i+1) ? (val_len-1) : (i+1)); - qs_decode(val); +#ifdef _MSC_VER + 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 {