aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJaeseung Ha <ipknhama@gmail.com>2017-09-17 18:29:52 +0900
committerGitHub <noreply@github.com>2017-09-17 18:29:52 +0900
commitc32aae4b5f4f8b6e9b63463103eca3546bdb44f9 (patch)
tree69af04bef0ff1f81b8f458fa05802a69cbacefa5 /include
parenta3b9c11112856ccc28e90e95feed568efadf3cae (diff)
parent366e7c7e4b09096874d712696e79a913c17dd2c3 (diff)
downloadcrow-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.h5
-rw-r--r--include/crow/query_string.h8
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
{