diff options
author | Jaeseung Ha <ipknhama@gmail.com> | 2017-09-17 18:29:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-17 18:29:52 +0900 |
commit | c32aae4b5f4f8b6e9b63463103eca3546bdb44f9 (patch) | |
tree | 69af04bef0ff1f81b8f458fa05802a69cbacefa5 /include | |
parent | a3b9c11112856ccc28e90e95feed568efadf3cae (diff) | |
parent | 366e7c7e4b09096874d712696e79a913c17dd2c3 (diff) | |
download | crow-c32aae4b5f4f8b6e9b63463103eca3546bdb44f9.tar.gz crow-c32aae4b5f4f8b6e9b63463103eca3546bdb44f9.zip |
Merge pull request #183 from philave/vs2015-compilation-fix
MS VS2015 compilation fix.
Diffstat (limited to 'include')
-rw-r--r-- | include/crow/json.h | 5 | ||||
-rw-r--r-- | include/crow/query_string.h | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/crow/json.h b/include/crow/json.h index 8b58180..e2d116c 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 78ccc67..ee61e30 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 { |