I believe I am hitting some boundary conditions, my requirement is to send some wifi scan report to mosquitto followed by Kibana
When I get wifi scan report in msg and try to convert that into a string as below
char *json = blobmsg_format_json(msg, true);
printf("json - %s and len - %ld", json, strlen(json));
this prints only 2048 characters in printf and strlen - ~28000
So my question is what is the max length of a constant string a char pointer can point to in C?
I am worried that char *json may not be pointing to complete string and what if I am getting only part of the string because of limitations?
More details: I suspected above problem in question then I tried to declare another char pointer with malloc and then copy the string followed by terminating the string later to make sure its null terminated
/* 30000 Magic number I am using only for this example where I
see that string len is not never greater than ~29000. This is
just a debug and not will never make it to production */
char *tmpjson = (char *) calloc(30000, sizeof(char));
strncpy(tmpjson, json, strlen(json));
strcat(tmpjson, "\"}");
printf("tmpjson - %s and len - %ld\n", tmpjson, strlen(tmpjson));
output is still the same as first printf except for terminating char