diff --git a/lib/misc/lws-struct-sqlite.c b/lib/misc/lws-struct-sqlite.c index 2fff76282..155688060 100644 --- a/lib/misc/lws-struct-sqlite.c +++ b/lib/misc/lws-struct-sqlite.c @@ -74,13 +74,13 @@ lws_struct_sq3_deser_cb(void *priv, int cols, char **cv, char **cn) if (map->aux == sizeof(int)) { int *pi; pi = (int *)(u + map->ofs); - *pi = atoi(cv[n]); + *pi = (int)atoll(cv[n]); /* 32-bit OS */ break; } if (map->aux == sizeof(long)) { long *pl; pl = (long *)(u + map->ofs); - *pl = atol(cv[n]); + *pl = (long)atoll(cv[n]); /* 32-bit OS */ break; } { diff --git a/minimal-examples/api-tests/api-test-lws_struct-json/test2.c b/minimal-examples/api-tests/api-test-lws_struct-json/test2.c index 128d01062..535adf933 100644 --- a/minimal-examples/api-tests/api-test-lws_struct-json/test2.c +++ b/minimal-examples/api-tests/api-test-lws_struct-json/test2.c @@ -38,11 +38,7 @@ static const char * const test2_json = "}," "\"frequency\":" "11," "\"arg1\":" "\"val2\"," -#if defined(_WIN32) - "\"arg2\":" "2147483647," -#else "\"arg2\":" "1420887242594," -#endif "\"priority\":" "3," "\"ssid\":" "\"\\\"nw1\\\"\"" "}" @@ -55,11 +51,7 @@ static const char * const test2_json_expected = "\"frequency\":0,\"arg2\":0,\"priority\":1}," "{\"creds\":{\"key1\":\"\\u0022xxxxxxxxxxxxx\\u0022\"}," "\"arg1\":\"val2\",\"ssid\":\"\\u0022nw1\\u0022\"," -#if defined(_WIN32) - "\"frequency\":11,\"arg2\":2147483647,\"priority\":3}]}" -#else "\"frequency\":11,\"arg2\":1420887242594,\"priority\":3}]}" -#endif ; /* @@ -87,7 +79,7 @@ typedef struct t2_config { const char *arg1; const char *ssid; unsigned int frequency; - unsigned long arg2; + unsigned long long arg2; unsigned int priority; } t2_config_t; @@ -148,7 +140,7 @@ t2_config_dump(struct lws_dll2 *d, void *user) lwsl_notice("%s: ssid '%s'\n", __func__, c->ssid); lwsl_notice("%s: freq %d\n", __func__, c->frequency); - lwsl_notice("%s: arg2 %lu\n", __func__, c->arg2); + lwsl_notice("%s: arg2 %llu\n", __func__, c->arg2); lwsl_notice("%s: priority %d\n", __func__, c->priority); lwsl_notice("%s: key1: %s, key2: %s\n", __func__,